Software Engineering 101

17
Software Engineering 101 22/10/2013 Pedro Melo Pereira

Transcript of Software Engineering 101

Page 1: Software Engineering 101

Software Engineering 10122/10/2013

Pedro Melo Pereira

Page 2: Software Engineering 101

2

Software Engineering

SE is the application of a systematic, disciplined, quantifiable approach to the design, development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software.

WikipediaSoftware Architecture Software Development

VS

“the big picture” the devil is in “the details”“promised vision” “delivered reality”

Moral: One cannot live without the other

“abstracted structure” “concise implementation”

Page 3: Software Engineering 101

3

Software Architecture

High level structure of a software system Discipline of creating such a high level structure Documentation of this high level structure

why is it important ?1. It will inhibit or enable a system’s driving quality attributes2. Allows to reason about and manage change as the system evolves3. Enables early prediction of a system’s qualities4. A documented architecture enables communication among stakeholders5. Carries the earliest and most fundamental, hardest-to-change design decisions6. Defines a set of constraints on subsequent implementation7. Relates to the structure of an organization8. Provides the basis for evolutionary prototyping9. Allows the architect and project manager to reason about cost and schedule10.Transferrable, reusable model that forms the heart of a system11.Focuses attention on the assembly of components, rather than simply on their

creation12.Channels the creativity of developers, reducing design and system complexity13.Foundation for training of a new team member

Page 4: Software Engineering 101

4

Software Architecture – Distributed Systems – Design Patterns

Client/Server – The server component provides a service to one or many clients, which initiate requests for such services. Clients and servers exchange messages in a request-response pattern.

Message Broker – pattern for message validation, transformation and routing. It mediates communication amongst applications, minimizing mutual awareness, effectively implementing decoupling.

P2P – A peer-to-peer network is decentralized and distributed network architecture in which individual nodes (peers) act as both suppliers and consumers of resources, in contrast to the centralized client/server model.

Page 5: Software Engineering 101

5

Software Architecture – Distributed Systems – Design Patterns

REST – Representational State Transfer has emerged as a predominant web API design model (integrated with HTTP).Consists of clients and servers, clients initiate requests to servers, servers process requests and return appropriate responses. Requests and responses are built around the transfer of representations of resources (captures the intended state of the resource).

SOA – Service Oriented Architecture is based on discrete pieces of software providing application functionality as services to other applications (known as Service orientation). A service is a self contained unit of functionality.

CRUD method HTTP method

Create POST

Read GET

Update PUT

Delete DELETE

Web ServiceMethod of communication over a network.contracts = WSDLmessages = SOAP

XMLStandard format for communication over a network

JSONAlternative to XML. Strong javascript integration

Page 6: Software Engineering 101

6

Software Architecture – Distributed Systems – Design Patterns

Three-Tier architecture – ubiquitous client/server architecture in which each layer is developed and maintained as a separate module. Each layer provides services for the layer above via well defined interfaces, for this they can be developed independently.

MVC – separates the representation of information from the user’s interaction with it. The model consists of application data, business rules, logic and functions. A view can be any output representation. The controller mediates input, converting it to commands for the model or view.

Page 7: Software Engineering 101

7

Software Architecture – Distributed Systems – Cloud Computing

IaaS – Infrastructure as a service PaaS – Platform as a service SaaS – Software as a service NaaS – Network as a service

concept

service models

characteristics Agility – improves re-provision of infrastructure

resources Cost – converts capital expenses to operational ones Virtualization – sharing of servers with increases

utilization Reliability – multiple redundant sites, suitable for BC or

DR Scalability/elasticity – dynamic provisioning response

for PL Performance – continuous monitoring and alerts Security – security patches are provided automatically Maintenance – job of off-site operators

Distributed computing over the Internet – ability to run an app on many connected devices

Virtual servers – hardware can be scaled up or down “like a cloud”

Legend BC – Business continuity DR – Disaster recovery PL – Peak loads

Page 8: Software Engineering 101

8

Software Development

Process of writing and maintaining source code, includes all that is involved between the conception of the desired software through to its final manifestations.

Wikipedia

Algorithms + Data Structures = Programs

Paradigms Imperative Functional Object-oriented Logic

LanguagesJava, C#, C++, Python, Ruby, Scala, Groovy, Javascript, Erlang, Clojure

Syntax(form)

Semantics

(meaning)

Page 9: Software Engineering 101

9

Software Development - Methodologies

Waterfall – sequential design processoriginated from the manufacturing andconstruction industries.Assumes each phase is self-contained. Too rigid to be used in environments where changeis constant.

Iterative – the system is developed in repeated cycles (iterative) and in smaller portions at a time (incremental). At each iteration a slice of functionality is delivered.Supports modularity of change.

Page 10: Software Engineering 101

10

Software Development - Methodologies

Agile – Evolution of the iterative model where requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. It promotes adaptive planning, evolutionary development and delivery.Focus on the team. Encourages rapid and flexible response to change.

XP - Extreme Programming Frequent releases / short cycles Do the simplest thing that will

work Avoid features until they are

needed Pair programming / Extensive

tests Thrives in chaotic environments

Scrum – Agile framework that focuses on team roles. Sprint – basic unit of development represented by a

deadline Daily scrum meeting – done yesterday / do today /

impediments Scrum master role – accountable for meeting sprint

deliveries

Page 11: Software Engineering 101

11

Software Development – Design

Use case diagram

UML – Unified Modeling LanguageGeneral purpose language for the field of software engineering. Graphic notation techniques to create visual models of object-oriented software.

Class diagram

Page 12: Software Engineering 101

12

Software Development – Design

Sequence diagram

Collaboration diagram

Page 13: Software Engineering 101

13

Software Development – Object Oriented Programming

Features Encapsulation – provides information hiding by restricting access to internal

representation Inheritance – hierarchy where classes inherit attributes and behaviour from

parent classes Polymorphism – ability of an object of one class to be used as an object of

another class Delegation – refers to one object relying upon another to provide a set of

functionalities Abstraction – share common meaning in objects with different implementations

OOP – Programming paradigm that represents concepts as “objects” that have data fields (attributes that describe the object) and associated procedures (methods that specify behaviour).

Page 14: Software Engineering 101

14

Software Development – Design Patterns

1. Creational – deal with object creation mechanisms2. Structural – organizes relationships between objects3. Behavioral – identify common communication patterns between objects

1. Singleton pattern – ensure a class has only one instance and provide a global point of access

2. Composite pattern – compose objects into tree structures in order to represent hierarchies

3. Observer pattern – an object maintains a list of its observers and notifies them on events

General reusable solution commonly occuring problems. Describes templates for how to solve problems that can be used in many different situations. Constitute formalized best-practices.

In the context of OOP

Types

Examples

Algorithm

strategyComputation

al

Execution

Implementation

Structural

Page 15: Software Engineering 101

15

Software Development – Databases

DBMS – Database Management System

SQL – Structured Query Language

Oracle, MS SQL Server, MySql, PostGresSql, MongoDb

Relational

Non-Relational (noSQL)

Transaction Properties - ACID Atomicity – if one part of the transaction fails, the entire transaction fails (all or

nothing) Consistency – transaction will bring the database from one valid state to another Isolation – concurrent execution results in a state as if transactions were

executed serially Durability – once a transaction has been committed, it will remain so (even if

there are power losses, crashes or errors)

Tables (encapsulates columns and rows)

Views Stored Procedures Indexes / Constraints / Triggers /

Sequences

Typical Database Objects

select departmentCode, employeeName from Employee where id=3

Sql example:

Page 16: Software Engineering 101

16

Software Development – Tests

Unit Tests – smallest testable part of an application (units of source code) Integration Tests – individual software models are combined and tested as a

group Acceptance Tests – used to determine the outcome of a complete functionality

or system Test-driven development – process in which tests are done before the rest of the

code

Provides information about the quality of the system under test.Allows the business to understand and manage the risks of software implementation.

Meets the requirements that guided its design and development

Works as expected Can be implemented according to the specified interfaces Satisfies the needs of stakeholders (non functional

requirements)

Process of validating that the software:

Approaches

White box testing (test internals)

Black box testing (test inputs & outputs)

Page 17: Software Engineering 101

17

Software Development – Release Management

Automated Builds – build versions by scripting repetitive tasks in order to be more productive

Automated Testing – integrate running tests into the build process. Avoids bugs early on.

Continuous Integration – automation of building frequent and up to date releases

Process of managing software releases from development stage to final version.

Software defects Issues Risks Software change requests New development requests and associated tasks Deployment and packaging

Provides support for managing:

Tools