Docsity

Software Testing - Software Engineering - Lecture Notes, Study notes of Software Engineering

Partial preview of the text

Download Software Testing - Software Engineering - Lecture Notes and more Study notes Software Engineering in PDF only on Docsity!

SE fundamentals 5 – Software Testing

Topics covered  Development testing  Test-driven development  Release testing  User testing

Program testing goals  What are the goals of testing?

Program testing goals  To demonstrate that software meets its requirements.  For custom software, at least one test for every requirement in the requirements document.  For generic software products, have tests for all of the system features AND feature combinations.  To discover situations in which the behavior of the software is incorrect or undesirable.  Defect testing is concerned with rooting out undesirable system behavior such as system crashes, unwanted interactions with other systems, incorrect computations and data corruption.

Testing process goals  Validation testing  To demonstrate to the developer and the system customer that the software meets its requirements  A successful test shows that the system operates as intended.  Defect testing  To discover faults or defects in the software where its behaviour is incorrect or doesn’t follow its specification  A successful test is a test that makes the system perform incorrectly.

An input-output model of program testing

V & V confidence  Aim of V & V is to establish confidence that the system is ‘fit for purpose’.  Depends on:  Software purpose

  • The level of confidence depends on how critical the software is to an organization.  User expectations
  • Users may have low expectations of certain kinds of software.  Marketing environment
  • Getting a product to market early may be more important than finding defects in the program.

 Software inspections : Analyze the static system representation to discover problems ( static verification)  May be supplemented by tool-based document and code analysis (discussed in Chapter 15).  Software testing: Exercise and observe product behaviour (dynamic verification)  The system is executed with test data and its operational behaviour is observed. Inspections and testing

Software inspections  People examine the source code to discover anomalies and defects.  Inspections do not require execution of a system.  They may be applied to any representation of the system (requirements, design, configuration data, test data, etc.)  They have been shown to be an effective technique for discovering program errors.

Software Inspections http://weblog.bosslogic.com/2007/07/formal- inspection-an-introduction/

Inspections and testing  Inspections and testing are complementary and not opposing verification techniques.  Both should be used during the V & V process.  Inspections can check conformance with a specification but not conformance with the customer’s real requirements.  Inspections cannot check non-functional characteristics such as performance, usability, etc.

Stages of testing  Development testing; the system is tested during development.  Release testing; a separate testing team tests a complete version of the system before it is released.  User testing, where users or potential users of a system test the system in their own environment.

Unit testing  Unit testing is the process of testing individual components in isolation.  The purpose is to discover defects  Units may be:  Individual functions  Object classes with several attributes and methods  Composite components with defined interfaces

Object class testing  Complete test coverage of a class involves  Testing all operations  Setting and getting all attributes  Test the object in all possible states.  Inheritance makes it more difficult to design object class tests.