CSEB233 Fundamentals of Software Engineering Module 5: Software Implementation/Coding Badariah Solemon 2010.

Slides:



Advertisements
Similar presentations
Object Oriented Analysis And Design-IT0207 iiI Semester
Advertisements

Verification and Validation
Software Quality Assurance Inspection by Ross Simmerman Software developers follow a method of software quality assurance and try to eliminate bugs prior.
Software Reuse Building software from reusable components Objectives
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Soft. Eng. II, Spring 02Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 6 Title : The Software Reuse Reading: I. Sommerville, Chap. 20.
Chapter 1 Program Design
Building software from reusable components.
1 Software Testing and Quality Assurance Lecture 1 Software Verification & Validation.
1CMSC 345, Version 4/04 Verification and Validation Reference: Software Engineering, Ian Sommerville, 6th edition, Chapter 19.
Problems with reuse – Increased maintenance costs; lack of tool support; not-invented- here syndrome; creating, maintaining, and using a component library.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Software Construction. Implementation System Specification Requirements Analysis Architectural Design Detailed Design Coding & Debugging Unit Testing.
Software Engineering Muhammad Fahad Khan
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 1 Design with Reuse l Building software from reusable components.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Software Engineering Reuse.
1 Software Construction Software Construction Chapter 1.
CSEB233 Fundamentals of Software Engineering Module 5: Software Implementation/Coding Badariah Solemon 2010.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Chapter 8 – Software Testing Lecture 1 1Chapter 8 Software testing The bearing of a child takes nine months, no matter how many women are assigned. Many.
 Explain the role of a system analyst.  Identify the important parts of SRS document.  Identify the important problems that an organization would face.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 1: Software and Software Engineering.
This chapter is extracted from Sommerville’s slides. Text book chapter
SE: CHAPTER 7 Writing The Program
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 1: Software and Software Engineering.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
This chapter is extracted from Sommerville’s slides. Textbook chapter
Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Chapter 19 Verification and Validation.
CHAPTER 9: VERIFICATION AND VALIDATION 1. Objectives  To introduce software verification and validation and to discuss the distinction between them 
Chapter 12: Software Inspection Omar Meqdadi SE 3860 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Chapter 8 Lecture 1 Software Testing. Program testing Testing is intended to show that a program does what it is intended to do and to discover program.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
INFO 637Lecture #71 Software Engineering Process II Product Implementation INFO 637 Glenn Booker.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
Software Quality Assurance and Testing Fazal Rehman Shamil.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
This chapter is extracted from Sommerville’s slides. Textbook chapter 22 1 Chapter 8 Validation and Verification 1.
Testing and Evolution CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVII. Verification and Validation.
Chapter 16 – Software Reuse
CSC 480 Software Engineering
Verification and Validation
Chapter 8 – Software Testing
Verification and Validation
Verification and Validation
Chapter 16 – Software Reuse
Software Reuse Objectives
Lecture 09:Software Testing
CSSSPEC6 SOFTWARE DEVELOPMENT WITH QUALITY ASSURANCE
Software Construction
Software life cycle models
Chapter 13 Quality Management
Software Construction
CS310 Software Engineering Lecturer Dr.Doaa Sami
Software Construction
Software Construction
Chapter 7 Software Testing.
Software Construction
Chapter 9: Implementation
Presentation transcript:

CSEB233 Fundamentals of Software Engineering Module 5: Software Implementation/Coding Badariah Solemon 2010

Objectives To explain what is software construction and why it is important To describe good programming principles/practices To introduce the concept of ‘defensive programming’. To describe software inspection as a static method to discover defects, errors or problems. To explain the concepts, benefits and problems of software reuse. Badariah Solemon 2010

What is software construction? ‘Construction’ refers to the hands-on part of creating something. Also known as implementation / coding and debugging & verification and validation (testing). Generally focus at coding, debugging, some detailed design and some testing (esp. unit testing). Quality of construction substantially affects the quality of the software. Badariah Solemon 2010

What is software construction? (cnt’d) According to McConnell (1993), construction may involves: – Verifying that the groundwork has been laid so that construction can proceed successfully. – Designing and writing routines and modules. – Selecting and creating data types and naming identifiers. – Selecting control structures and organizing blocks of statements. – Finding and fixing errors. – Reviewing other team members’ design and code and having them review yours. – Polishing code – formatting and writing comments (i.e. internal documentation). – Integrating software components (if built separately). – Tuning code – make it more efficient, smaller and faster. Badariah Solemon 2010

Why is software construction important? Depending on the size of the project, construction may takes 30% to 80% of the total project time. The larger the time spent, the bigger the work affect the success of the project. Construction is the pivotal activity in software development. With a focus on construction, there is a great potential for the average programmer’s productivity to improve. Requirements document and design documents can go out of date, but construction’s by product, the source code, is always up to date. Ideally software project goes through requirements engineering and modeling activities before construction begins. In reality, construction is the only activity that’s guaranteed to be done! (Source: McConnel, 1993, pp. 5) Badariah Solemon 2010

Good programming practices Generic practices: 1.Start with a good design. Update the design documents regularly. Create additional design documents before adding major new features or functionality. 2.The program under development should be at all times functioning. The development process consists of adding new functionality without breaking existing functionality. 3.Work has to be divided into small incremental steps that can be typically accomplished and code-reviewed in one day. Even large-scale rewrites should be made incremental. 4.Every line of code written or modified undergoes peer review. The smallest team must contain at least two programmers so that they can code-review each other's changes. 5.Always attempt to work top-down in: – Design—start with high level objects. – Implementation—create top-level objects using low-level stubs. – Modification—change the top-level objects and the overall flow of control first. If necessary, use stubs, or fake new functionality using old implementation. (Source: Badariah Solemon 2010

Good programming practices (cnt’d) 1.Be consistent with formatting. 2.Be consistent with naming conventions. 3.Use global [identifiers] sparingly. 4.Don't assume output formats. 5.Add comment to your code – explain what and why 6.Provide useful error messages. 7.Recover (or fail) gracefully. 8.Push interface up and implementation down. 9.Know what you don't know – prepare for changes. (Source: Kim Moser at ) Badariah Solemon 2010

Defensive Progamming Defensive programming is when the programmer makes necessary assumptions and creates code that anticipates potential problems and specification changes. – According to Tushar Mehta (2009), defensive programming involves: a)finding problems in the existing code by identifying code inconsistencies and understanding typical uses of the software, b)anticipating – and preempting – both potential problems with the existing specifications as well as likely changes in user behavior and design specifications, and c)streamlining the code to aid readability and simplify maintainability. – A good defensive programmer is sufficiently confident in her abilities to ignore the traditional belief that “If it isn’t broke, don’t fix it.” Badariah Solemon 2010

Defensive Progamming Example: Handle unexpected conditions Do you always have a "default" case in you "switch" statements? switch($some_value) { case 1: $another_value = 1; break; case 2: $another_value = 4; break; } return(1 / $another_value); What if $some_value is not 1 nor 2? Notice: Undefined variable: another_value Warning: Division by zero Badariah Solemon 2010

Defensive Progamming Example: Process external systems data properly Validate your input What do you do with the data entered by the users? What about data of files or data retrieved from remote sites? Are you verifying whether it comes in the format that your application expects? Always validate external data in any case. This means that you should always check if data comes in the expected format, and do not proceed in case the data is not valid. Examples are taken from: practices-to-prevent-breaking-your-sites.html Badariah Solemon 2010

Software Inspections An ‘old school’ approach. A process to review, analyze and check static system representations such as requirements document, design document, and program source code to look for errors and problems. – Static – need not run the software on a computer Generally, focus at source code. Sometime also known as peer reviews or program/code inspections. Inspections can check conformance with a specification but not conformance with the customer’s real requirements. But, inspections cannot check non-functional characteristics such as performance, usability, etc. Badariah Solemon 2010

Program/code Inspection Process Focus at detecting defects (i.e. logical errors & anomalies in the code). Program inspections are very effective in discovering defects. A formal process that involve a team of several members – Fagan originally developed this method at IBM in the 1970s with four suggested roles – author, reader, tester & moderator Badariah Solemon 2010

Advantages of Inspection over Testing According to Sommerville (2004): 1.A single inspection session can discover many errors in a software/system. During program testing, errors can mask (hide) other errors. 2.Incomplete versions of a software/system can be inspected without additional costs. To test an incomplete program, need to develop specialized test to test the parts that are available. 3.Inspections can search for program defects and other quality attributes of a program E.g., compliance with standard, portability, maintainability, efficiency, and etc. Badariah Solemon 2010

Drawbacks/Issues related to Inspections 1.Difficult to introduce formal inspections into software development organizations. 2.Software engineers (programmers) with experience are sometimes reluctant to accept that inspections can be more effective for detecting defects (errors) than testing. 3.Managers may be sceptical as inspections require extra costs during modelling and construction. 4.Inspections may take time to arrange and appear to slow down the development process. Badariah Solemon 2010

Software reuse According to Sommerville (2004): – In most engineering disciplines, systems are designed by composing existing components that have been used in other systems – Software engineering has been more focused on original development but it is now recognised that to achieve better software, more quickly and at lower cost, we need to adopt a design process that is based on systematic reuse rather than ad-hoc reuse Systematic reuse -? Badariah Solemon 2010

Reuse-based software engineering Application system reuse – The whole of an application system may be reused either by incorporating it without change into other systems (COTS reuse) or by developing application families Component reuse – Components of an application from sub-systems to single objects may be reused Object and function reuse – Software components that implement a single well- defined function may be reused Badariah Solemon 2010

Requirements for Reuse It must be possible to find appropriate reusable components The reuser of the component must be confident that the components will be reliable and will behave as specified The components must be documented so that they can be understood and, where appropriate, modified. Badariah Solemon 2010

Benefits of reuse Increased dependability – Software/components/function has been tried and tested in working systems, so should be more dependable than new software. Reduced process risk – Less uncertainty in development costs especially if a large software components are reused. Effective use of specialists – Reuse components instead of people. The specialist can create reusable components Standards compliance – Standards such as UI standard (e.g., drop-down menu) can be implemented as reusable components to improve dependability as users are less likely to make mistake Accelerated development – Avoid original development, speed-up production and hence able to market product early Badariah Solemon 2010

Reuse problems Increased costs – in understanding whether the application/component/function is suitable for reuse, in testing it to ensure its dependability and in maintaining the reused item. Lack of CASE tool support Not-invented-here syndrome – Some software engineers may think that writing original software is seen as more challenging than reusing other people’s software. Maintaining a component library can be expensive Finding and adapting reusable components Badariah Solemon 2010

Summary You have been introduced to: – good programming principles/practices – the concept of ‘defensive programming’. – software inspection as a static method to discover defects, errors or problems. – the concepts, benefits and problems of software reuse Badariah Solemon 2010

References Tushar Mehta ( mehta.com/excel/vba/vba- defensive_programming.htm) mehta.com/excel/vba/vba- defensive_programming.htm Sommerville, I Software Engineering, 7th Ed. Addison Wesley: Boston. McConnell, S Code Complete. Microsoft Press: Bangalore, India. Badariah Solemon 2010