Written by Luka Kerr on June 13, 2018

Software Development Life Cycle (SDLC)

  1. Analysis & Specification
    • Understanding the problem
    • Gather requirements
    • Use case modelling, user stories
  2. Design
    • Domain modelling
    • Design artifacts
  3. Implementation
    • Programming the solution
  4. Testing
    • Unit tests, integration tests, user acceptance tests
  5. Release & Maintenance
    • Releasing the software
    • Fixing defects, adding new functionality

Requirements

A condition or capability needed by a user to solve a problem or achieve an objective

Use Cases

Use Case Diagram

A use case diagram portrays how actors interact with various parts of the system.

Includes:

Domain Model

OO Principles

Abstraction

Encapsulation

Inheritance

Association

CRC Cards

Software Development Methodologies

Waterfall Model

Rational Unified Process (RUP)

Agile

Advantages:

Disadvantages:

Extreme Programming (XP)

User Stories

A user story must contain 3 main parts: a role, goal and benefit. For example:

As a customer I want to create an account so that I can shop online

To create a good user story, follow the INVEST acronym:

Epic Stories

Epic story are short overarching goals that encapsulate multiple smaller user stories.

UML Diagrams

There are 2 broad categories of UML diagrams:

Sequence Diagram

Activity Diagram

Effective Software Design

Design Smells

Refactoring

Characteristics of Good Design

Good software design aims to have loose coupling and high cohesion, so the software is extensible, reusable, maintainable, understandable and testable.

SOLID Principles

Testing

Types:

Test Coverage:

Measures the degree to which software has been exercised by tests

Code Coverage:

Measures the degree to which the source code of a program has been tested

Test Driven Development:

Equivalence Testing:

Boundary Testing:

Errors in Python

Exceptions:

# create a custom exception
class MyException(BaseException):
  def __init__(self, messages):
    self.messages = messages
# raise an exception
raise MyException("a message")
# catch an exception
try:
  # try to something that might raise an exception
except MyException:
  # executed when MyException is raised
finally:
  # always executed
else:
  # executed when there is no exception

Asserts:

def func():
  x = 5
  assert x > 0

Testing With PyTest

import pytest

# check for exception being raised
with pytest.raises(BookingError) as info:
  call_function()
  assert info == "error message"

Databases

Database Design Steps:

  1. Analyse requirements, identify data and operations
  2. Model data at a high, abstract level (OO/ER models)
  3. Create a database schema
  4. Implement the database by creating an instance of the schema
  5. Build operations/interface such as stored procedures, SQL
  6. Tune performance
  7. Evolve and develop schema

Aims of Data Modelling:

ER Diagrams

Relational Data Model

Database Schema:

Mapping ER Diagram to Relational Data Model

The following ER concepts map to a relational data model:

Software Architecture

An architecture style is defined by:

Types of software architectures:

Diagrams

Use Case Diagram

Domain Model (Class Diagram)

ER Diagram

ER Relational Model

CRC Card