Five Principles for Engineering High Quality Software Principles for Engineering High Quality...
Transcript of Five Principles for Engineering High Quality Software Principles for Engineering High Quality...
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
© Vector Software, Inc. © Vector Software, Inc. © Vector Software, Inc. © Vector Software, Inc. © Vector Software, Inc. © Vector Software, Inc.
Five Principles for Engineering High Quality Software www.vectorcast.com
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Agenda
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Five Principles for Engineering High Quality Software
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
Why high quality software?
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Who downloads latest greatest software version? > Windows and Service Packs; Windows 10?
> So many choices > There are 200+ flash lights application in
Google Play store
> Reviews and community can kill your
product
Why high quality software?
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
What is the effort to fix a bug ?
What is the impact of a bug on
your product?
Why high quality software?
Cost of fixing a bug depending of time passed since introduction.
Avoid bugs and fix bugs as early in the process as possible
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Five Principles for Engineering High Quality Software
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
The program shall switch on a LED when the input equals to 1 and switch off the LED when input equals to 0.
1. Use Code Coverage analysis to measure testing completeness
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
1. Use Code Coverage analysis to measure testing completeness
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
1. Use Code Coverage analysis to measure testing completeness
/* This function is called before terminating the program and deallocates all acquired memory */ void CleanOnExit(Object * memory) { //... }
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Use coverage for code completeness
> „How many test cases?” is a wrong question
> Dead code is dangerous
> Important questions? > How much code coverage is enough?
> Can we get 100% coverage from system testing only?
1. Use Code Coverage analysis to measure testing completeness
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Five Principles for Engineering High Quality Software
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why Unit Testing?
2. Improve test coverage with unit test
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Test units in isolation (using mocks and stubs)
> Help you really understand the design of the code
> Faster detected bug, cheaper to fix
> Instant feedback
> Simulate low-level functionality > What happens when malloc returns null?
> What happens if we pass null object to a function?
> What happens if we give boundary values?
> ...
> Reuse of code (and tests)
> Fill coverage gap with unit testing
Use Code Coverage
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Five Principles for Engineering High Quality Software
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Different flavours of tests are build by different engineers > Developer Tests
> Integration Tests
> System Tests
> Available test campaigns > Regression Testing
> Scripted testing
> Smoke testing
> Exploratory testing
> Guerilla testing
> Scenario testing
> Load testing
> Performance testing
> ...
> Who can run test campaigns? > Everyone or every campaign has its owner?
3. Make tests easy to run, and test results easy to understand
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
3. Make tests easy to run, and test results easy to understand
> Make your test cases and reports easy to understand
> Or you want to be like this guy?
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Make test case simple and readable
> Allow developers to run any test cases they want
> Keep it simple to run – one button, one command
> Make test results easy to understand...
3. Make tests easy to run, and test results easy to understand
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Five Principles for Engineering High Quality Software
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Tests are partitioned among many groups => how long does it take to run test camping ?
> Minutes, hours, days ?!
4. Implement automated parallel and change based Testing
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Automate!
> Automation is a tool, not a strategy. > Quickly detect destabilizing changes in new builds
> Quickly, detect regression bugs
> Quickly report problems (and make fixing easier)
> Parallel Test Execution > Running hundreds of test cases at the same time
> Change-Based Testing > Running only tests affected by each software change
> Why waste resources on a few lines change?
4. Implement automated parallel and change based Testing
Save time and resources!
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Five Principles for Engineering High Quality Software
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
What is refactoring?
> Makes code easy to understand
> Makes code easy to extend
> Speeds up creation of complicated systems
5. Constantly Refactor code to improve maintainability
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
Why should I refactor?
> Remove complicated and duplicated code
> Make code easy to understand for yourself
> Make code easy to understand for others
> Extend code quicker
> Make better tests
5. Constantly re-factor code to improve maintainability
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
What is code smell? "a code smell is a surface indication that usually corresponds to a deeper problem in the system„
Martin Fowler
> Duplicating code
> Dead code
> Long and complex functions > Cyclomatic complexity less than M
> ...
5. Constantly re-factor code to improve maintainability
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
> Why High Quality Software?
> 1. Use Code Coverage analysis to measure testing completeness
> 2. Improve test coverage with unit tests
> 3. Make tests easy to run, and test results easy to understand
> 4. Implement automated parallel and change based Testing
> 5. Constantly re-factor code to improve maintainability
> Q&A
Agenda
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
VectorCAST
VectorCAST Test Management Platform
ALM, Requirements Gateway
Analysis, Metrics Reporting Model-Based Development
Coverage Unit Test Static
Analysis Compiler, Debugger, RTOS, Simulator
Cluster Control
Continuous Integration
Compiler, Debugger, RTOS, Simulator
Legacy Tests
Technical Debt
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
Coding
Architecture
Requirements Specification
System Design
System Testing
Integration Testing
Unit Testing
VectorCAST
© V
ecto
r So
ftw
are,
Inc.
©
Vec
tor
Soft
war
e, In
c.
Q&A
vecto rca st . co m
Proven Solutions for Reliable Software
Questions?
www.vectorcast.com [email protected]