Introduction to software testing

Page 1

Introduction to Testing

1


Testing Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software implementation. Test techniques include the process of executing a program or application with the intent of finding software bugs (errors or other defects). It involves the execution of a software component or system component to evaluate one or more properties of interest. In general, these properties indicate the extent to which the component or system under test: •meets the requirements that guided its design and development, •responds correctly to all kinds of inputs, •performs its functions within an acceptable time, •is sufficiently usable, •can be installed and run in its intended environments, and •achieves the general result its stakeholders desire.


Test phases 

Acceptance Testing – this checks if the overall system is functioning as required.

Unit testing – this is basically testing of a single function, procedure, class.

Integration testing – this checks that units tested in isolation work properly when put togheter.

System testing – here the emphasis is to ensure that the whole system can cope with real data, monitor system performance, test the system’s error handling and recovery routines.

Regression Testing – this checks that the system preserves its functionality after maintenance and/or evolution tasks.


Unit Testing    

Unit Tests are tests written by the developers to test functionality as they write it. Each unit test typically tests only a single class, or a small cluster of classes. Unit tests are typically written using a unit testing framework, such as automatic unit tests. Target errors not found by Unit testing: - Requirements are mis-interpreted by developer. - Modules don’t integrate with each other


a white-box approach Testing based on the coverage of the executed program (source) code. Different coverage criteria: • statement coverage • path coverage • condition coverage • definition-use coverage • …..

It is often the case that it is not possible to cover all code. For instance: - for the presence of dead code (not executable code) - for the presence of not feasible path in the CFG - etc.


a black-box approach 1.describe the system using a Use-Cases Diagram * a use-case of that diagram represents a functionality implemented by the system

2.detail each use-case with a textual description of, e.g., its pre-post conditions and flow of events * events are related to: (i) the interactions between system and user; and (ii) the expected actions of the system * a flow of events is composed of basic and alternate flows

3.define all instances of each use-case (scenarios) executing the system for realizing the functionality 4.define, at least, one test case for each scenario 5.(opt) define additional test cases to test the interaction between use-cases.


How to select input values? Different approaches can be used: -

Random values: -

-

Tester Experience: -

-

for each input parameter we randomly select the values

for each input we use our experience to select relevant values to test

Domain knowledge: -

we use requirements information or domain knowledge information to identify relevant values for inputs


How to select input values? Different approaches can be used: -

Equivalence classes: -

-

we subdivide the input domain into a small number of sub-domains the equivalence classes are created assuming that the SUT exhibits the same behavior on all elements few values for each classes can be used for our testing

Boundary values: – –

is a test selection technique that targets faults in applications at the “boundaries” of equivalence classes experience indicates that programmers make mistakes in processing values at and near the boundaries of equivalence classes


How to select input values? -

Combinatorial testing: -

test all possible combination of the inputs is often impossible e.g., method(a:int,b:int,c:int) .. how many combinations? with 10 values per input: 103 =1000 with 100 values per input: 1003 =1000000

-

selection of relevant combinations is important -

Pairwise testing (aka 2-way): cover all combinations for each pair of inputs <a,b> <a,c> <b,c> = 102 + 102 +102 =300 don’t care about the value of the third input


Traditional Approaches for acceptance testing 

Manual Acceptance testing. User exercises the system manually using his creativity.

Acceptance testing with “GUI Test Drivers” (at the GUI level). These tools help the developer do functional/acceptance testing through a user interface such as a native GUI or web interface. “Capture and Replay” Tools capture events (e.g. mouse, keyboard) in modifiable script.


Table-based Approach for acceptance testing 

Starting from a user story (or use case or textual requirement), the customer enters in a table (spreadsheet application, html, Word, …) the expectations of the program’s behavior.

At this point tables can be used as oracle. The customer can manually insert inputs in the System and compare outputs with expected results. 11


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.