June 09, 2019

Cause and Effect Analysis

Cause Effect diagram is a popular technique to establish the root cause(s) of a problem. A cause-and-effect diagram is a visual representation to find out one or more causes of a specific problem. It allows exploration of possible causes. People use it to correct defects in their products or services. Other names for the cause and effect diagram are cause effect graph, herringbone diagram, ishikawa diagram and fishikawa (because it looks like the bones of a fish).

Cause Effect Diagram Template
 

If you want to learn more, please see my cause effect video in my Software and Testing Training channel or read on...

June 02, 2019

State Transition Testing Technique with Examples

State Transition Testing is a test design technique, which you can use to design test cases. Now, what is a state in state transition? A state is a particular condition in which the system under test can exist. A state A state has certain attributes or properties and it has a certain behavior. What is transition? A transition is movement from one valid (allowed) state to another valid state. These transitions are tested in state transition testing. View the detailed State Transition Testing tutorial or read on...

Light switch example State Diagram




Let us assume that a lighting system has a switch, an electric circuit and a light. As you can see in the state transition diagram above, there are only two valid states in which this system can exist - OFF and ON. In the OFF state, you can provide an input (turn switch on) to cause a transition to the ON state with the output that the light becomes on. In the ON state, you can provide an input (turn switch off) to cause a transition to OFF state with the output that the light becomes off. In state transition testing, you would test both these transitions i.e. OFF state to ON state and ON state to OFF state.

Car State Diagram example


Let us see another state transition example. The above diagram is also called the the State Graph or the State Chart or State Transition Chart or State Transition Graph. This diagram shows the four possible states of a car - Stopped, Accelerating, Constant Speed and Braking. From the Stopped state, the system can only change to the Accelerating state. From the Accelerating state, it is possible to change to the Constant Speed state and vice versa. From the Constant Speed state, it is possible to change the car to the Braking state and vice versa. From the Braking state, it is possible to change to the Accelerating state and vice versa. Also, from the Braking state, it is possible to change to the Stopped state. Therefore, there are 8 valid transitions (represented by 8 arrows) that you should test.

State Table and State Diagram are related. The same information is shown in the form of a state table or state transition table. The first 8 rows after the header are the valid transitions. The next 4 rows are the invalid transitions. You should also test the invalid transitions to ensure that they are impossible.

StateInputNext State
StoppedPress gas pedal Accelerating
AcceleratingKeep gas pedal constantConstant Speed
AcceleratingSwitch to brake pedalBraking
Constant SpeedPress gas pedal moreAccelerating
Constant SpeedSwitch to brake pedalBraking
BrakingSwitch to gas pedal; press gas pedal moreAccelerating
BrakingSwitch to gas pedalConstant Speed
BrakingKeep brakingStopped
Stopped?Constant Speed
Stopped?Braking
Accelerating?Stopped
Constant Speed?Stopped

You can design state transition testing test cases based on the state transition table. For example, you can write test cases based on the workflows as follows. Ensure that you cover each valid transition and each invalid transition.
Test case 1– Stopped | Accelerating | Constant Speed | Braking | Stopped
Test case 2– Stopped | Accelerating | Braking | Accelerating | Braking | Stopped
Test case 3 – Stopped | Accelerating | Constant Speed | Accelerating | Constant Speed | Braking | Constant Speed | Braking | Stopped
and so on.

I hope that you found the above state diagram examples useful.to understand state transition testing. If you want to learn more, you can view my State Transition Testing tutorial. I have explained the above concepts in greater detail in it.

May 26, 2019

Requirements Analysis in Software Testing Example

What is software requirement? Software requirements are functional or nonfunctional needs that must be provided by the system. They are expressed as statements, typically with examples. Now, what is requirement analysis? Requirements analysis in software testing means careful review of the software requirements with respect to each requirement quality (first column in table below) to find out requirement bugs and fix them. Software requirements analysis is needed for both functional and nonfunctional requirements. Let us understand requirements analysis techniques with examples. The bad requirements have bugs in red. Then I have converted them to good requirements :

Requirement qualityExample of bad requirementExample of good requirement
Atomic Students will be able to enrol to undergraduate courses and post-graduate courses. Students will be able to enrol to undergraduate courses.
Students will be able to enrol to post-graduate courses.
Uniquely identified 1 - Students will be able to enrol to undergraduate courses.
1 - Students will be able to enrol to post-graduate courses.
1 Course enrolment
1.1 - Students will be able to enrol to undergraduate courses.
1 .2 - Students will be able to enrol to post-graduate courses.
Complete A professor user will log into the system by providing his username, password and other relevant information. A professor user will log into the system by providing his username, password and department code.
Consistent and unambiguous A student will have either under-graduate courses or post-graduate courses but not both.
Some courses will be open to both under-graduate and post-graduate students.
A student will have either under-graduate courses or post-graduate courses but not both.
Traceable Maintain student information --- mapped to BRD req. ID ? Maintain student information --- mapped to BRD req. ID 4.1
Prioritized Register Student - Priority 1
Maintain User Information - Priority 1
Enrol courses - Priority 1
View Report Card - Priority 1
Register Student - Priority 1
Maintain User Information - Priority 2
Enrol courses - Priority 1
View Report Card - Priority 3
Testable Each page of the system will load in an acceptable time-frame. Register Student and Enrol Courses pages of the system will load within 5 seconds.


If you want to learn more, I have explained the above requirement analysis examples in detail in the tutorial on my YouTube channel, Software and Testing Training