Week7 Testing
Week7 Testing
Week 7
Software Engineering
Wk Lecture Practical
1 Introduction Canvas, Assessment Understand the case study.
Software lifecycle Write the user stories.
Design the database and the
2 Work as a group! Agile software
Plan the work on the UI Review of the software requirements and Set the version control
and the Use Case design
diagram. Review of the OOP concepts.
3 User Stories Git
4 Plan the work on the Graphical User Interface. MVC pattern. Coding
user stories Retrospective
Check if you are on track.
5 Plan the work on the Create and connect the database to the
database application.
From UML to C# code
6 Plan the current task Testing – Manual and Automated
http://agilemanifesto.org/principles.html
Software Testing
www.thedailywtf.com
Software Testing
… because
The “developer makes the worst tester”
The “software at rest” problem
The “no data” problem
Preventing bugs
What we need…
Tools and techniques that will enable
developers to write code without introducing
bugs.
Example:
What tests would you perform to test the
login
ID screen?
Test Result
1 User name correct, pwd correct pass
2 User name correct, pwd wrong fail
3 User name wrong, pwd correct fail
4 User name wrong, pwd wrong fail
5 User name empty, pwd empty fail
6 User name correct, pwd empty fail
7 User name empty, pwd correct fail
Automated vs Manual Testing
Let’s assume:
Each test can be run manually in 1 min. =>
takes 7 mins (420 secs) to perform all
the test manually
OR
Write a method that tests the login screen –
takes 10 mins (600 secs)
Run all the tests – takes 10 secs.
600
500
400
Automated testing
Manual testing
300
200
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Automated vs Manual Testing
Automated testing Manual testing
The same operation is performed each time The testers should perform the same tests
every time. But do they?
The tests are ran with the same values. It’s flexible
http://www.embedded.com/
Automated Unit Testing
How can the automation be done in C#?
Martin, R., Agile Software Development, Principles, Patterns, and Practices, Pearson
2013
Test driven development
Advantages:
• By writing the tests first the programmers
enforce how the methods have to be called
(the signature); they think at both
functionality and interface.
• The program has to be testable (the tests
are already written) therefore, it has to be
decoupled.
• The tests can act as a form of
documentation.
• The programmers are not afraid to change.
Regression testing
http://www.slideshare.net/bugstan/six-sigma-4601516
Regression testing
Acceptance
tests
Unit tests
Quiz
The difference between re-testing and
regression testing is:
A.re-testing is running a test again;
regression testing looks for unexpected side
effects
B.re-testing looks for unexpected side
effects; regression testing is repeating
those tests
C.re-testing is done after faults are fixed;
regression testing is done earlier
D.re-testing uses different environments,
regression testing uses the same environment
Quiz
The main focus of acceptance testing is :
A.finding faults in the system
B.ensuring that the system is acceptable to
all users
C.testing the system with other systems
D.testing for a business perspective
E.testing by an independent test team
Quiz
Which is NOT true - The black box tester: :
A.should be able to understand a functional
specification or requirements document
B.should be able to understand the source
code
C.is highly motivated to find faults
D.is creative to find the system’s weaknesses
Quiz
Which of the following need to be assessed during unit testing?
A. algorithmic performances
B. code stability
C. error handling
D. execution paths
E. Both c and d
Quiz
Regression testing should be a normal part of integration testing
because as a new module is added to the system new
A. control logic is invoked
B. data flow paths are established
C. drivers require testing
D. all of the above
E. both a and b
Quiz
Acceptance tests are normally conducted by the
A. Developers
B. end users
C. test team
D. system engineers
Questions