0% found this document useful (0 votes)
22 views

Week7 Testing

Uploaded by

Yu Won
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Week7 Testing

Uploaded by

Yu Won
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Software Engineering

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

7-9 Retrospective. Design patterns More coding.


Plan the current task. Accomplish the quality.
Secure coding.
10 Software Validation and Verification Double check.
No new features.
Software Maintenance. Enhancements.
11 Software Management.
12 Review Presentation
Learning Objectives

1. To understand the importance of testing.


2. To learn about different types of testing.
3. To understand the importance of test
automation.

http://agilemanifesto.org/principles.html
Software Testing

“Customers buy features and tolerate


bugs.”
Scott Wadsworth

“Anyone who has ever used a computer


understands that software fails. From
the very first program to the most
recent modern application, software
has never been perfect. Nor is it ever
likely to be.”
Software Testing

Loss of customers is a major side effect of


buggy software, particularly in the cloud
where so many alternatives exist.

www.thedailywtf.com
Software Testing

How did the software changed over the last 20


years?

How did the software changed the world over


the last 20 years?

Does the software have less bugs than it had


20 years ago?

Where do the software bugs come from?


Preventing bugs

To prevent introducing bugs:


• write better specs,
• perform code reviews
• run static analysis tools
• perform unit testing

If we know about all of these why don’t we


have bug-free software?
Preventing bugs

… because
The “developer makes the worst tester”
The “software at rest” problem
The “no data” problem
Preventing bugs

To prevent introducing bugs:


• write better specs,
• perform code reviews
• run static analysis tools
• perform unit testing

These techniques are still used to reduce the number of bugs.


Preventing bugs

What we need…
Tools and techniques that will enable
developers to write code without introducing
bugs.

The supersonic futuristic car by Marko Lukovic


Detecting bugs

There are two ways the software can be dynamically analysed:


- Automated testing
- Manual testing
Testing

What types of testing can you think of?


• Unit
• Functional
• Acceptance
• Regression
• Security
• Accessibility
• etc
Unit Testing

What is unit testing?

Is the process in which small units (parts)


of a software application are individually
and independently tested.
Unit Testing

How can the unit testing be done?


• Manually
• Automated
Manual Testing

Manual Testing is the process of running each


individual module/program and comparing the
results to the expectations, in order to find
the defects in the program.
The testers use the program as the user would
under all possible scenarios.
The testers have to be sure that all the
features act according to the requirements.
Automated Testing

Automated testing is the process of running


tools to compare the software’s expected
outcomes with the actual outcomes.
Automated vs Manual Testing

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.

The login screen is part of an application. 20


iterations are needed until the final release
Automated vs Manual Testing

How much time is involved in testing?


700

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?

Very useful in regression testing Not reliable in regression testing

Time consumed is constant Time consumed increases with the


frequency

Can be done concurrently on different Can’t be done concurrently, unless more


machines/platforms testers are involved.

Not good for UI testing Good for UI testing

The tests are ran with the same values. It’s flexible

Good for large projects Good for small projects

http://www.embedded.com/
Automated Unit Testing
How can the automation be done in C#?

Project: Build a small calculator.


Automated Unit Testing

“The act of writing an unit test is more an act of design than of


verification. It is more an act of documentation than a
verification.”

Martin, R., Agile Software Development, Principles, Patterns, and Practices, Pearson
2013
Test driven development

The tests are designed and developed before


the software is designed and developed.
Every method of the program has a test that
verifies its behaviour.
The tests are run whenever:
• a new feature is added / removed
• the functionality or the structure is
changed
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

Regression testing is the re-execution of the


tests in order to check whether previous
functionality of application is still working
and new bugs have not been introduced.

http://www.slideshare.net/bugstan/six-sigma-4601516
Regression testing

When should the regression testing be performed?

• any change in original functionality


• new feature added
• a bug fix
Acceptance Testing

Acceptance tests are written to test if the


software works properly as a whole.

They don’t check individual modules


(methods).

If written first the acceptance tests have an


effect upon the system’s architecture.

The acceptance tests can be written by the


customer.
Acceptance 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

You might also like