Bài giảng Introduction to Software Engineering - Week 9: Software Testing - Nguyễn Thị Minh Tuyền

Week 9:  
Software Testing  
Nguyễn Thị Minh Tuyền  
Adapted from sSlidoemsmoef rIavnille  
Software Testing  
1. What is it?  
2. Who does it?  
3. What are the steps?  
4. What is the work product?  
5. How do I ensure that I’ve done it right?  
Topics covered  
1. Development testing  
2. Test-driven development  
3. Release testing  
4. User testing  
3
Program testing  
£ Testing is intended  
p to show that a program does what it is intended to do and  
p to discover program defects before it is put into use.  
£ When you test software, you execute a program using  
artificial data.  
£ You check the results of the test run for errors,  
anomalies or information about the program's non-  
functional attributes.  
£ Can reveal the presence of errors NOT their absence.  
£ Testing is part of a more general verification and  
validation process, which also includes static validation  
techniques.  
4
Program testing goals  
Validation  
testing  
To demonstrate to the developer and the customer that the  
software meets its requirements.  
Defect  
testing  
To discover situations in which the behavior of the software  
is incorrect, conform to its  
specification.  
5
An input-output model of program testing  
Input test data  
Inputs causing  
anomalous  
behaviour  
I
e
System  
Outputs which reveal  
the presence of  
defects  
Output test results  
O
e
6
Verification vs validation  
£ Verification:  
"Are we building the product right”.  
p The software should conform to its specification.  
£ Validation:  
"Are we ct”.  
p The software should do what the user really requires.  
7
V & V confidence  
£ Aim of V & V is to establish confidence that the  
system is 'fit for purpose'.  
£ Depends on  
p Software purpose: The level of confidence  
depends on how critical the software is to an  
organisation.  
p User expectations: Users may have low  
expectations of certain kinds of software.  
p Marketing environment: Getting a product to  
market ant than finding  
defects in the program.  
8
Inspections and testing  
£ Software inspections  
p Concerned with analysis of the static system  
representation to discover problems(static  
verification)  
p May be supplement by tool-based document and  
code analysis.  
£ Software testing  
p Concerned with exercising and observing product  
behaviour (dynamic verification)  
p The system is executed with test data and its  
operational behaviour is observed.  
9
Inspections and testing  
Inspections  
Requirements  
specification  
Software  
architecture  
UML design  
models  
Database  
schemas  
Program  
Testing  
System  
prototype  
10  
Software inspections  
£ Involve people examining the source  
representation with the aim of discovering  
anomalies and defects.  
£ Do not require execution of a system so may be  
used before
£ May be applied to any representation of the  
system (requirements, design, configuration data,  
test data, etc.).  
£ Have been shown to be an effective technique for  
discovering program errors.  
11  
Advantages of inspections  
£ During testing, errors can mask (hide) other  
errors. Because inspection is a static process,  
you don’t have to be concerned with  
interactions between errors.  
£ Incomplettem can be  
inspected without additional costs.  
£ As well as searching for program defects, an  
inspection can also consider broader quality  
attributes
p such as compliance with standards, portability and  
maintainability.  
12  
Inspections and testing  
£ Both 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.  
13  
A model of the software testing process  
Test  
Test  
Test  
Test  
cases  
data  
results  
reports  
Design test  
cases  
Prepare test  
data  
Run program  
with test data  
Compare results  
to test cases  
An abstract model of the ‘traditional’ testing process, as used in plan-driven  
development  
14  
Stages of testing  
£ Development testing  
p the system is tested during development to discover  
bugs and defects.  
£ Release testing  
p a separate ete version of the  
system before it is released to users.  
£ User testing  
p users or potential users of a system test the system in  
their own e
15  
Topics covered  
1. Development testing  
2. Test-driven development  
3. Release testing  
4. User testing  
16  
Development testing  
£ Includes all testing activities that are carried out by the  
team developing the system.  
£ Unit testing  
p Individual program units or object classes are tested.  
p Should focus on testing the functionality of objects or methods.  
£ Component testing  
p Several individual units are integrated to create composite  
components.  
p Should focus on testing component interfaces.  
£ System tes
p Some or all of the components in a system are integrated and  
the system is tested as a whole.  
p Should focus on testing component interactions.  
17  
Unit testing  
£ Is the process of testing individual components in  
isolation.  
£ Is a defect testing process.  
£ Units may be:  
p Individual functions or methods within an object  
p Object classes with several attributes and methods  
p Composite components with defined interfaces used to  
access their functionality.  
18  
Object class testing  
£ Complete test coverage of a class involves  
p Testing all operations associated with an object  
p Setting and interrogating all object attributes  
p Exercising the object in all possible states.  
£ Inheritance o design object  
class tests as the information to be tested is not  
localised.  
19  
The weather station object interface  
WeatherStation  
identifier  
reportStatus ( )  
powerSave (instruments)  
remoteControl (commands)  
reconfigure (commands)  
shutdown (instruments)  
20  
Tải về để xem bản đầy đủ
pdf 60 trang yennguyen 19080 Free
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Introduction to Software Engineering - Week 9: Software Testing - Nguyễn Thị Minh Tuyền", để tải tài liệu gốc về máy hãy click vào nút Download ở trên

File đính kèm:

  • pdfbai_giang_introduction_to_software_engineering_week_9_softwa.pdf