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

1.Lecture 1

The document provides an overview of a Software Engineering course, detailing the course objectives, assessment criteria, and the importance of Software Quality Assurance (SQA) in developing high-quality software products. It covers the software engineering process, including specification, development, validation, and evolution, while emphasizing the significance of test-driven development (TDD) as a methodology for ensuring software quality. Additionally, it outlines the elements of SQA and the iterative process of TDD, highlighting its benefits and providing examples of practical application.

Uploaded by

kle27512
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

1.Lecture 1

The document provides an overview of a Software Engineering course, detailing the course objectives, assessment criteria, and the importance of Software Quality Assurance (SQA) in developing high-quality software products. It covers the software engineering process, including specification, development, validation, and evolution, while emphasizing the significance of test-driven development (TDD) as a methodology for ensuring software quality. Additionally, it outlines the elements of SQA and the iterative process of TDD, highlighting its benefits and providing examples of practical application.

Uploaded by

kle27512
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Lecture 1

Course Overview
Software Engineering
Software Quality Assurance
Test Driven Development
Lecturer contact

o Name : Dr.Nguyen Quang Khanh


o Email : [email protected]
Course assessment

❑ Weekly performance: 10%


❑ Progress: 30%
❑ Exam: 60%

❑ Evening: (17h25 – 19h30) & (19h30 – 21h35)


Part 1

COURSE OVERVIEW
Course Objectives
• Learn & apply software engineering process
• Understand software quality
• Deliver a well-documented software product
• Learn techniques to measure, ensure and
improve software quality
• Learn software testing
• Learn test-driven software development
Why study SQA?
• To create better software products.
• To become a better software engineer.
• To be able to join professional software
development teams.
• People's lives are affected by quality of the
software they use.
Why software engineering?
• Software is an essential part of our modern
world.
• There are increasing demands for large, complex
software products.
• Individual programmers are unable to develop
software systems…
– In large-scale
– With high quality
– On time
– Within budget
What is software failure?
• Does not satisfy customer's needs
• Contains (hard-to-spot) bugs
• Late delivery (or not at all), overbudget
• Caused by:
– Complex, changing requirements
– Limited budget, time, human resources
– The lack of quality assurance
Examples of software failure
• Smartphone apps not functioning correctly
and drains battery fast
• Course website ocasionally inaccessible
• Software-controlled car brake sometimes not
working
• Internet banking system calculates money
transactions incorrectly
Consequences of software failure
• Money is lost
• People's lives are endangered
• Business operations are interrupted
Main activities of software engineering
1. Software specification
Customers and engineers define
the software to be produced and
the constraints on its operation.

2. Software development
The software is designed and
programmed.
Main activities of software engineering
3. Software validation
The software is checked to ensure
that it is what the customer
requires.

4. Software evolution
The software is modified to reflect
changing customer and market
requirements.
Software Process
A software process is a set of related activities that
leads to the production of a software product.
(Ian Sommerville, 2011)

Core activities of a A software process is


software process more than just a set of
– Requirements Analysis activities. It also includes
– Design the information on
– Programming when and how these
– Testing activities are carried out,
– Deployment as well as people's roles
– Maintenance in those activities.
Software Process Model
• A software process model describes a specific
order based on which software process
activities should be performed.
– It can be considered as a framework for devising
software processes.
• Some software process models:
– Waterfall, Incremental, Iterative
– Agile, Prototyping, Formal Methods
Where does SQA fit in?

• SQA is an umbrella activity. It is applicable in


every stage of a software process.
• All roles (manager, analyst, programmer,
tester, administrator…) can practice SQA.
– There is often a Quality Assurance team in a
software project. However, they are not the only
ones who do quality assurance. Instead, they
monitor and assist other teams in order to ensure
software quality.
Good software
• Good software should deliver the required
functionality and performance to the user and
should be maintainable, dependable, and
usable.
Attributes of Software Quality

Software quality can be determined by answering questions such as:


1. Is the software usable?
2. Is the software reliable enough to be used?
3. Is the performance of the software acceptable for normal use?
4. Does the development process follow established standards?
5. Has the software been properly tested?
6. Is the software well structured and understandable?
Software quality assurance
• A set of proceduces and techniques applied in
software development life cycle to ensure
software quality.
• Quality assurance (QA) is done when the
software is being built.
– While Quality Control (QC) is done on the
software product to verify its quality.
The elements of SQA
• Software process
• SQA planning
• Review activities
– Discovering defects (testing)
– Progress assessment (process enforcement)
– Quality review (quality measurement)
• Risk identification & reduction
• SE standards
Part 2

TEST-DRIVEN DEVELOPMENT
TEST-DRIVEN DEVELOPMENT
TEST-DRIVEN DEVELOPMENT
Test-Driven Development
• Originated from Extreme Programming (XP)
– XP is a software engineering methodology
– The author of TDD is Kent Beck
• Basic principle: test first
– Programmer should also be tester
– If you can't test, you shouldn't code
• Coding is done in small iterations
– The program builds up little-by-little
TDD iteration
1. Write a Test for a feature
– Quickly make the test compile
– Run the test to see it returns FAILED
2. Write necessary code to make the test PASS
– As fast as possible
– No need to be real code or good code
3. Refactor the code
– All tests must still PASS
– Remove bad, duplicated codes
– Apply (good) code conventions
TDD benefits
• Instant feedback
• More confidence on the resulting program
• Better development practices
– Well organized code
– Less bugs
JUnit
• The basic idea:
– For a given class Foo, create another class
FooTest to test it.
– The FooTest class contains various methods,
each of which is a test case.
– The tester writes some assertion statements in
the test case method's body.
– The test case returns PASS if all assertions return
True and FAILED otherwise.
JUnit
• Example of a JUnit test class:
TDD Example
• Writing the Circle program.
– Create Circle objects.
– Calculate Area, Diameter.
– Increase, decrease Radius.
Step 1a – Write a Test
Step 1b – Make the Test compile
• Create the Circle class.
• Write a constructor.
• Write the getRadius() method that
returns any number (say, 0).
Step 1c – Run the Test
• Just to see that it FAILED
Step 2a – Write code
• Just enough to make it PASS
Step 2b – Run the Test again
• Just to see that it PASS
Step 3a – Remove bad, duplicated codes

• Create the radius instance variable and use it in


the constructor and the getRadius() method.
Step 3b – Apply conventions

• Make the radius variable private.


Exercise
• Repeat the TDD process to add the remaining
features to the Circle program.
– assertEquals is the only testing command
you know for now, but it's fine.
• Take notes of the little steps that you do like
the example just now.
Home Reading
• Chapter 8.2 - Test-driven development
From Software Engineering 10th Ed. (2016) by
Ian Sommerville.

• Chapter 17 - Software quality assurance


From Software Engineering, A Practitioner's
Approach 9th Ed. (2019) by Pressman.

You might also like