Sie sind auf Seite 1von 13

Detailed Design and Coding

Detailed Design Specifications


Customer thinks of requirements
Analyst derives Functions Designer creates Design specifications Developer writes code Specs provide a detailed design of components to be developed Design specs should follow all of the best practices such as abstraction and functional independence where possible

Functional Module Specification


Utilizes functional abstraction: specifies a
set of input and desired a set of output, as well as the relationship between the two Pre-conditions: specify input constraints on the module Post-Conditions: specify output constraints on the module Example from lab: get list of available venues

Class Specifications
Axiom: an established rule assumed to be
true based on which classes are built A class represents data and functions that operate on that data Axiomatic specifications:
Syntactic Specification: defines the interfaces and internal variables of a module Semantic Specification: defines the meaning and behavior of a module

Design Notations Graphical Notations

Flow charts: defines processes and the


flow of control Box diagrams: used to define
Sequence Repetition/recursion If, then, else Selection

Tabular Design Notations


Used to evaluate complex conditions Examples
Used to define available actions based on user roles Used to define possible outcomes of a Rules Engine module

A chart is populated with conditions and


results, which are then marked True or False based on requirements

Object Oriented Notations


Class diagram: defines the following
Class Attributes Class Operations (a.k.a. functions, methods)

Sequence diagram: represents a single


use case
Could involve multiple objects Example from lab: a diagram showing all interactions between objects used to insert an event

Pseudocode
Helps translate design into implementation
in a clear and precise manner Not tied to any particular language, but your pseudocode will likely look like your favorite language with syntax errors Since it is much more procedural than natural language, it can easily be translated to actual code.

Coding Best Practices


Use meaningful names for modules and

variables Never use Goto statements if you can avoid them. Some languages dont even support them Use proper indentation, parenthesis, comments, and blank space Keep global variables to a minimum to reduce side-effects

Cohesion and Coupling


Interfaces between modules should be defined
on the basis of cohesion and coupling. Cohesion should be high
All elements of a module are directed toward a single task Interdependence between modules should be minimal.

Coupling should be low

High cohesion and low coupling go hand in hand because if all elements directed toward a single task are in a single module, then there is less need for modules to have interdependencies.

Code Verification Unit Testing Dynamic Technique


Prepare a test case and execute the
program with the test case. You can automate this process by writing code that will create the test case This technique will detect the presence of errors
Lab Example: write unit test scripts that will insert a Customer, insert a Venue, and book an event, making assertions that check for the existence of the items at the end of the test

Code Verification Unit Testing Static Technique


Involves checking logical execution of the
program and detects errors directly Methodical Analysis: Using tools to check for data flow problems such as unreachable code, unused variables Symbolic Execution: Test all conditions. You can use tools to see unused code. Desk Review: Bottom-up analysis to ensure that the business requirements are met.

Code Review
The point is to detect errors in the code and

minimize testing efforts Looking for things like missing validations, adherence to standards, etc. Code review effort can be minimized with the development of solid unit tests that are run each time the code is compiled because such unit tests do the review for you.

Das könnte Ihnen auch gefallen