Mantas Radzevičius ifm-2/2

Slides:



Advertisements
Similar presentations
Design Principles & Patterns
Advertisements

Since 1995, we’ve been building innovative custom solutions specifically designed to meet the unique needs of America’s most recognized companies. If you.
St Louis Day of.NET 2011 Refactoring to a SOLID Foundation Steve Bohlen Senior Software Engineer SpringSource/VMware Blog:
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
SOLID Object Oriented Design Craig Berntson
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Chapter 25 GRASP: More Objects with Responsibilities 1CS6359 Fall 2011 John Cole.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Test-Driven Development “Test first, develop later!” –OCUnit.
CLASS DESIGN PRINCIPLES Lecture 2. The quality of the architecture What is a good design? It is the design that at least does not have signs of “bad”.
1 OO Design Novosoft, 2001 by V. Mukhortov. 2 OO Design Goals  Flexibility Changes must be localized  Maintainability Modules requiring changes can.
Ch:10 Component Level Design Unit 4. What is Component? A component is a modular building block for computer software Because components reside within.
Company Confidential – Do Not Duplicate 2 Copyright 2008 McLane Advanced Technologies, LLC S.O.L.I.D. Software Development Achieving Object Oriented Principles,
© 2004 Capgemini - All rights reserved SOLID - OO DESIGN PRINCIPLES Andreas Enbohm, Capgemini.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.
S.O.L.I.D. Software Development 12 January 2010 (Martin Verboon, Patrick Kalkman, Stan Verdiesen)
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
The benefits of SOLID in software development Ruben Agudo Santos (GS-AIS-HR)
 What is SOLID  The S in SOLID  The O in SOLID  The L in SOLID  The I in SOLID  The D in SOLID  Questions.
Software Design Principles
Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns.
Elements of OO Abstraction Encapsulation Modularity Hierarchy: Inheritance & Aggregation 4 major/essential elements3 minor/helpful elements Typing Concurrency.
OO Design Principles Copyright © Vyacheslav Mukhortov, Nikita Nyanchuk-Tatarskiy, Copyright © INTEKS LLC,
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Design for testability as a way to good coding Simone Chiaretta Architect, Council of the EU December 9 th,
Software testing techniques Software testing techniques Software Testability Presentation on the seminar Kaunas University of Technology.
High Cohesion Low Coupling Old Standards for Object Oriented Programming.
Five design principles
Design and Planning Or: What’s the next thing we should do for our project?
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
Principles of Object Oriented Design
PRINCIPLES OF OBJECT ORIENTED DESIGN S.O.L.I.D. S.O.L.I.D Principles What is SOLID?  Acrostic of 5 Principles:  The Single Responsibility Principle.
Refactoring Agile Development Project. Lecture roadmap Refactoring Some issues to address when coding.
SOLID Design Principles
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Session 33 More on SOLID Steve Chenoweth Office: Moench Room F220 Phone: (812) Chandan Rupakheti Office: Moench.
SOLID PHP & Code Smell Wrap-Up
CSHenrik Bærbak Christensen1 Flexibility and Maintainability And their metrics: coupling and cohesion.
Microsoft Advertising 16:9 Template Light Use the slides below to start the design of your presentation. Additional slides layouts (title slides, tile.
Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
Interface Segregation / Dependency Inversion
Course information Old exam Resit Report Result and walkthrough
Object-Orientated Analysis, Design and Programming
Programų testuojamumas
Neringa Sipavičienė IFM-2/4
“When quality is critical"
Software Architecture & Difference from Design
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
Copyright © by Curt Hill
Software Engineering: A Practitioner’s Approach, 6/e Chapter 11 Component-Level Design copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
object oriented Principles of software design
Component-Level Design
Chapter 4 Functions Objectives
Object-Oriented Design
An Introduction to Software Architecture
Chapter 19 Technical Metrics for Software
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
A (partial) blueprint for dealing with change
European conference.
Object Oriented Design & Analysis
Software Development Chapter 1.
Dependency Inversion principle
Some principles for object oriented design
Chapter 10 – Component-Level Design
Presentation transcript:

Mantas Radzevičius ifm-2/2 Software testability Mantas Radzevičius ifm-2/2

Software testability? Huh? Definition of software testability: The ease with which a computer program can be tested; “Software testability is the degree to which software artifact (i.e. a software system, software module, requirements or design document) supports testing in a given test context” © Wikipedia; “Attributes of software that bear on the effort needed to validate the software product” © ISO.

Heuristics of Software testability Controllability Observability Availability Simplicity Stability Information

Controllability The better we can control it, the more testing can be optimized. Software and hardware states and variables can be controlled directly by the test engineer Software modules, objects, or functional layers can be tested independently.

Observability What you see is what can be tested. All factors affecting the output are visible Past system states and variables are visible or queriable System states and variables are visible or queriable during execution

Availability To test it, we have to get at it. The system has few bugs Source code is accessible

Simplicity The simpler it is, the less there is to test The design is self-consistent The feature set is the minimum necessary to meet requirements Modules are cohesive and loosely coupled Code simplicity

Stability The fewer the changes, the fewer the disruptions to testing. Changes to the software are controlled and communicated Changes to the software do not invalidate automated tests

Information The more information we have the smarter we will test. Technology on which the product is based is well understood Dependencies between internal, external and shared components are well understood. The purpose of the software is well understood

Short version The software testability can be measured by the level of your headache and curse words per minute. (lower is better)

Testability of Requirements Requirements have to be: Consistent Complete Unambiguous Quantitative Verifiable in practice

Why software testability matters? Poor testability Ineffective/Awkward tests Consequences

Why software testability matters? Economics side: Higher testability -> More better tests -> hopefully less bugs Lower testability -> Less better tests -> bugs++ You (with higher testability): Overall less headaches Smile on your face Good night sleep Effective work

Improving software testability Test driven development: Tests first code later Red-Green-Refactor Automated CI The earlier tests are written the better – encourages testable design

Improving software testability (SOLID) S (SRP) – Single Responsibility Principle “There should never be more than one reason for a class to change” O (OCP) – Open/Closed Principle Software entities should be open for extension but closed for modification L (LSP) – Liskov Substitution Principle “base class must be able to use objects of derived class without knowing it” I (ISP) – Interface Segregation Principle “Clients should not be forced to depend upon interfaces that they do not use” D (DIP) – Dependency Inversion Principle “High level modules should not depend upon low level modules. Both should depend upon abstractions”

Law of Demeter Original paper Another explanation A method of an object should invoke only the methods of the following kinds of objects: Itself Its parameters Any objects it creates/instantiates Its direct component objects Your method can call other methods in its call directly Your method can call methods on its own fields directly When your method takes parameters, your method can call methods on those parameters directly When your method creates local objects, that method can call methods on the local objects

Others cool words note to mention DRY – DON’T REPEAT YOURSELF KISS – KEEP IT SIMPLE STUPID

Rule of thumb

Read & Learn Robert C. Martin “The Clean Coder” Martin Fowler “Refactoring: Improving the design of existing code” Robert C. Martin “Clean Code” Find another book to read

Got questions??

What is software testability? Why is software testability important? The Questions: What is software testability? Why is software testability important? Name 3 heuristics of software testability? What is SRP? (general idea) (bonus) Basic idea of Law of Demeter? LOD ============================================= Each unit should have only limited knowledge about other units: only units "closely" related to the current unit. Each unit should only talk to its friends; don't talk to strangers. Only talk to your immediate friends.

Thank you