Friday, November 21, 2014

Boundary value analysis & equivalence Partitioning with Example

Equivalence Partitioning:
In this method the input domain data is divided into different equivalence data classes
Boundary value analysis:
‘Boundary value analysis’ testing technique is used to identify errors at boundaries rather than finding those exist in center of input domain
E.g.: If you are testing for an input box accepting numbers from 1 to 1000 then- 
Test cases for input box accepting numbers between 1 and 1000 using Equivalence Partitioning:
1) One input data class with all valid inputs. Pick a single value from range 1 to 1000 as a valid test case. If you select other values between 1 and 1000 then result is going to be same. So one test case for valid input data should be sufficient.
2) Input data class with all values below lower limit. I.e. any value below 1, as a invalid input data test case.
3) Input data with any value greater than 1000 to represent third invalid input class.
Test cases for input box accepting numbers between 1 and 1000 using Boundary value analysis:
1) Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 1000 in our case.
------------
2) Test data with values just below the extreme edges of input domains i.e. values 0 and 999.
3) Test data with values just above the extreme edges of input domain i.e. values 2 and 1001.

Agile And Scrum

Agile model, Scrum
     Agile:
    # based on iterative and incremental development
    # Customer satisfaction by rapid delivery of useful software
    # Welcome changing requirements, even late in development
    # Working software is delivered frequently
    # Close, daily co-operation between business people and developers
    # Face-to-face conversation is the best form of communication (co-location)
    # Projects are built around motivated individuals, who should be trusted
    # Self-organizing teams
    # Regular adaptation to changing circumstances

    # Agile methods break tasks into small increments with minimal planning, and do not directly involve long-term planning.
    # Iterations are short time frames (timeboxes) that typically last from one to four weeks. # Each iteration involves a team working through a full software development cycle including planning, requirements analysis, design, coding, unit testing, and acceptance testing when a working product is demonstrated to stakeholders.
    # Stakeholders produce documentation as required.

    # Team composition in an agile project is usually cross-functional and self-organizing without consideration for any existing corporate hierarchy or the corporate roles of team members.
    # Team members normally take responsibility for tasks that deliver the functionality an iteration requires.

    Scrum:
    # iterative, incremental methodology for project management often seen in agile software development
    # The main roles in Scrum are:
       1. the “ScrumMaster”, who maintains the processes (typically in lieu of a project manager)
       2. the “Product Owner”, who represents the stakeholders and the business
       3. the “Team”, a cross-functional group of about 5-9 people who do the actual analysis, design, implementation, testing, etc.

    # During each “sprint”, typically a two to four week period (with the length being decided by the team), the team creates a potentially shippable product increment (for example, working and tested software).

    # The set of features that go into a sprint come from the product “backlog”, which is a prioritized set of high level requirements of work to be done. Which backlog items go into the sprint is determined during the sprint planning meeting. During this meeting, the Product Owner informs the team of the items in the product backlog that he or she wants completed. The team then determines how much of this they can commit to complete during the next sprint, and records this in the sprint backlog.[4] During a sprint, no one is allowed to change the sprint backlog, which means that the requirements are frozen for that sprint. Development is timeboxed such that the sprint must end on time; if requirements are not completed for any reason they are left out and returned to the product backlog. After a sprint is completed, the team demonstrates how to use the software.

    # Represents a radically new approach for planning and managing software projects brings decision making authority to the level of operation properties and on certainties, scrum reduces defects , makes development process more efficient and reduces long term maintenance cost.[7]

        * What have you done since yesterday?
        * What are you planning to do today?
        * Do you have any problems that would prevent you from accomplishing your goal? (It is the role of the ScrumMaster to facilitate resolution of these impediments, although the resolution should occur outside the Daily Scrum itself to keep it under 15 minutes.)

    Thursday, November 20, 2014

    SQL: Play wid dates

    1. Get the system date-

    select GETDATE() as 'Today''sDate'

    Output-
    Today'sDate

    2014-11-21 00:11:16.593

    2. Extract YY, MM, DD, H/M/S from the date
    Year/Month/Day
    select Year(GETDATE()) as 'Year', Month(GETDATE()) as 'Month', Day(GETDATE()) as 'Day'
    Output
    Year Month Day
    2014 11 21

    H/M/S
    select DATEPART(HH, getdate()) as 'Hour', DATEPART(MM, getdate()) as 'Minute', DATEPART(S, GETDATE()) as 'Second'

    Output
    Hour Minute Second

    0 11 59

    3. DATEPART Function


    Syntax
    DATEPART(datepart,date)

    Commonly Used datepart


    datepartAbbreviation
    yearyy, yyyy
    monthmm, m
    dayofyeardy, y
    daydd, d
    weekwk, ww
    weekdaydw, w
    hourhh
    minutemi, n
    secondss, s

    4. DATEADD function
    Syntax
    DATEADD(datepart,number,date)
    e.g. Adding an year to current date
    Select DATEADD(YY, 1, getdate()) as 'NextYear'
    Output
    NextYear
    2015-11-21 00:32:33.570

    Selecting only date part using Convert function
    Select CONVERT(DATE, DATEADD(YY, 1, getdate())) as 'NextYear'
    Output
    NextYear

    2015-11-21

    5. DATEDIFF function
    Syntax
    DATEDIFF(datepart,startdate,enddate)

    e.g. Getting days difference between today and yesterday

    select DATEDIFF(DD, Getdate()-1, GetDate()) as 'Days between today & yesterday'
    Output
    Days between today & yesterday

    1

    6. Sample Problem- 
    Find all the employees who were hired in October 2003 from below data

    select empid, lastname, firstname, hiredate from HR.employees

    empid lastname firstname hiredate
    1 Davis Sara 2002-05-01 00:00:00.000
    2 Funk Don 2002-08-14 00:00:00.000
    3 Lew Judy 2002-04-01 00:00:00.000
    4 Peled Yael 2003-05-03 00:00:00.000
    5 Buck Sven 2003-10-17 00:00:00.000
    6 Suurs Paul 2003-10-17 00:00:00.000
    7 King Russell 2004-01-02 00:00:00.000
    8 Cameron Maria 2004-03-05 00:00:00.000

    select empid, lastname, firstname, hiredate from HR.Employees
     where DATEPART(YY, hiredate)=DATEPART(YY,DATEADD(YY, -11, getdate()))
     AND DATEPART(MM, hiredate)=DATEPART(MM, DATEADD(MM, -1, getdate()))

    Output
    empid lastname firstname  hiredate
    5 Buck Sven 2003-10-17 00:00:00.000

    6 Suurs Paul 2003-10-17 00:00:00.000