software engineering @ leic/leti · introdução à engenharia de software sérgio guerreiro fca...

123
Software Engineering @ LEIC/LETI Lecture 1

Upload: voquynh

Post on 09-Dec-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Software Engineering @ LEIC/LETI

Lecture 1

[email protected]

António Rito Silva Francisco Regateiro

David Duarte

Logistics

Classes

Lectures

The concepts and real examples

Focussed on what is going on with the project

Interrupt me!

Laboratories

Size complexity

Technology to manage complexity

maven, git, …

Teacher is a facilitator

Helps in project management

Project

Project to learn, exam to assess

Groups

Groups of 6

Enrolmentduring the labs

Office Hours

António Rito SilvaMonday from 15:30 to 19:15 in room 535 INESC-ID

Grading

• Tests - 70% (min 9.0 out of 20) (10/4, 16/6, 7/7)

• 50% theory

• 50% project

• Project - 30% (min 8.0 out of 20)

• divided into 5 parts

• Final Grade =

• if E < 9.0 then RE

• if P < 8.0 then RE

• if (0,7E + 0,3P) < 9.5 then RE

• else ROUND(0,7E + 0,3P)

Bibliography

and

articles on the internet

and

(https://antonioritosilva.org/software-engineering-companion/ integrates concepts and interrelates with internet sources)

Secondary

Code Complete 2: A Practical Handbook of Software Construction 2nd Edition

[Paperback] Steve McConnell

2004

Introdução à Engenharia de Software Sérgio Guerreiro

FCA 2015

Goals

An introduction to software engineering

further developed in the MSc

Present the different areas

from requirements to code

Integrate what you have learned so far in the context of building software artefacts

from computer science to engineering

Motivate the different dimensions of software engineering

from technology to human

Software development as a collaborative activity

the course project

What is software engineering?

Some definitions

Software engineering is an engineering discipline that is concerned with all aspects of

software productionIan Sommerville

The purpose of software engineering is to develop

software-based systems that let customers achieve business goals

Ivan Marsic

Software Engineering is the branch of computer science that creates practical, cost-effective solutions to computing and

information processing problems, preferably, by applying scientific

knowledge, and developing software systems in the service of mankind

Mary Shaw

Software engineering is about methods, tools and techniques used for developing software

Douglas Bell

The goal of software engineering (...) is the creation of software systems that meet the needs of customers

and are reliable, efficient, and maintainable. In addition, the system

should be produced in an economical fashion, meeting project

schedules and budgetsEric J. Braude and Michael E. Bernstein

The application of a systematic, disciplined, quantifiable approach to

the development, operation, and maintenance of software; that is, the

application of engineering to software

The IEEE's definition

So…

Build software artefacts

Achieve business goals

Execute on top of the Turing machine

Maximize value

Minimize cost

It is engineering!

Project

Adventure Builder

Component View

: BrokerApplication

Server: Broker

Database

: BankApplication

Server

: BankDatabase

: ActivityApplication

Server

: ActivityDatabase

: HotelApplication

Server

: HotelDatabase

interacts withinteracts with

interacts with

interacts with

interacts with interacts with interacts with

: Browser

: Browser

: Browser

: Browser

interacts with

interacts with

interacts with

interacts with

: CarApplication

Server

: CarDatabase

interacts with

interacts with

: TaxApplication

Server

: TaxDatabase

interacts with: Browserinteracts with

interacts with

Allocate modules to components

: BankApplication

Server

: BankDatabase

: ActivityApplication

Server

: ActivityDatabase

interacts with interacts with

: Browser

interacts with

: CarApplication

Server

: CarDatabase

interacts with

: Browser

interacts with

: Browser

interacts withbank

executes the code

activity

executes the code

car

executes the code

: HotelApplication

Server

: HotelDatabase

: BrokerApplication

Server

: BrokerDatabase

interacts with interacts with

: Browser

interacts with

: TaxApplication

Server

: TaxDatabase

interacts with

: Browser

interacts with

: Browser

interacts withhotel

executes the code

broker

executes the code

tax

executes the code

Bank Module

String codeString name

Bank *1

String IDString name

Client

String IBANint balance

Account

String referenceOperationType typeint valueDateTime time

Operation 1*

1

*

1

*

Activity Module

String nameString code

ActivityProvider

String nameString codeint minAgeint maxAgeint capacity

Activity*1

LocalDate beginLocalDate endint capacity

ActivityOffer*1

String reference

Booking*1

Hotel Module

String codeString name

Hotel

String numberRoomType type

Room*1

String referenceLocalDate arrivalLocalDate departure

Booking*1

Car Module

String nameString code

Rent-A_Car

String plateint kilometers

Vehicle*1

String referenceString drivingLicenseLocalDate beginLocalDate endint kilometers

Renting*1

Car Motorcycle

Broker Module

String codeSting name

Broker

String IDLocalDate beginLocalDate endint ageString IBANint amountString bankPaymentString roomBookingString activityBooking

Adventure*

1

int raeErrors

AdventureState11

InitialState PayedState ConfirmedState CanceledState

Tax ModuleIRS

String NIFString nameString address

TaxPayer*1

String referencefloat valuefloat IVALocalDate date

Invoice

int tax

ItemType

Seller Buyer

1

*

1

*

*2 {1 Seller, 1 Buyer}

Iterative Development

Single Process: Java Virtual Machine

broker

bank

hotel activity

tax car

Client + Database: Java Virtual Machine

broker

bank

hotel activity

: AdventuresDatabase

interacts with

tax car

Application Servers: Broker

ApplicationServer

: BrokerDatabase

: BankApplication

Server

: BankDatabase

: ActivityApplication

Server

: ActivityDatabase

: HotelApplication

Server

: HotelDatabase

broker

bank

activity

interacts with

interacts with interacts with interacts with

executes the code

executes the code

executes the code

executes the code

: CarApplication

Server

: CarDatabase

car

interacts with

executes the code : TaxApplication

Server

: TaxDatabase

tax

interacts with

executes the code

Complete Integration

: BrokerApplication

Server: Broker

Database

: BankApplication

Server

: BankDatabase

: ActivityApplication

Server

: ActivityDatabase

: HotelApplication

Server

: HotelDatabase

interacts withinteracts with

interacts with

interacts with

interacts with interacts with interacts with

: Browser

: Browser

: Browser

: Browser

interacts with

interacts with

interacts with

interacts with

: CarApplication

Server

: CarDatabase

interacts with

interacts with

: TaxApplication

Server

: TaxDatabase

interacts with: Browserinteracts with

interacts with

: JMeter

tests

tests

tests

teststests

tests

Git

distributed version control system

Git

distributed version control system

the team is coding

Git

distributed version control system

the team is coding several versions of the same files

Artefact Versioning

V0 V1 V2 V3

suporta versões

suporta versões

suporta versões

Example:Create a file

Starting with a central repo…Origin repository

8c2c

Developers clone from originOrigin repository

8c2c

8c2c

8c2c

Dev-A repository

Dev-B repository

git clone <repository-url>

Lets name thingsOrigin repository

Dev-A repository

8c2c

masterorigin/master HEAD

Dev-B repository

8c2c

masterorigin/master HEAD

8c2c

master

Dev-A: create HelloWorld.javaOrigin repository

Dev-A repository

8c2c

masterorigin/master HEAD

Dev-B repository

8c2c

masterorigin/master HEAD

8c2c

master

HelloWorld.java

Dev-A: create HelloWorld.javaOrigin repository

Dev-A repository

8c2c

masterorigin/master HEAD

Dev-B repository

8c2c

masterorigin/master HEAD

8c2c

master

HelloWorld.java [untracked]

Dev-A: stage HelloWorld.javaOrigin repository

Dev-A repository

8c2c

masterorigin/master HEAD

Dev-B repository

8c2c

masterorigin/master HEAD

8c2c

master

HelloWorld.java [staged]

git add HelloWorld.java

Dev-A: commitOrigin repository

Dev-A repository

8c2c

origin/master

Dev-B repository

8c2c

masterorigin/master HEAD

8c2c

master

HelloWorld.java [unmodified]

git commit

901f

master HEAD

Dev-A: sync to originOrigin repository

Dev-A repository

8c2c

Dev-B repository

8c2c

masterorigin/master HEAD

8c2c

master

git push

901f

901f

masterorigin/master HEAD

ze$ git clone https://github.com/tecnico-softeng/reference.git

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspace

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

change in workspace

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

change in workspace

ze$ git add README.md

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

change in workspace

ze$ git add README.md

add to staging

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

change in workspace

ze$ git add README.md

add to staging

ze$ git commit -m “add ze info"

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

change in workspace

ze$ git add README.md

add to staging

ze$ git commit -m “add ze info"

create version in local

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

change in workspace

ze$ git add README.md

add to staging

ze$ git commit -m “add ze info"

create version in local

ze$ git push origin master

ze$ git clone https://github.com/tecnico-softeng/reference.git

copy from remote to local and to workspaceze$ edit README.md

change in workspace

ze$ git add README.md

add to staging

ze$ git commit -m “add ze info"

create version in local

ze$ git push origin master

create version in remote

ze$ edit README.md

ze$ edit README.md change in Zé workspace

ze$ edit README.md change in Zé workspacemia$ edit README.md

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspace

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia staging

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé staging

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info"

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia local

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remote

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info"

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé local

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdated

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zé

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md Zé solves conflicts

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md Zé solves conflictsze$ git add README.md

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md Zé solves conflictsze$ git add README.md add to Zé staging

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md Zé solves conflictsze$ git add README.md add to Zé staging

ze$ git commit -m “add merge with…”

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md Zé solves conflictsze$ git add README.md add to Zé staging

ze$ git commit -m “add merge with…”create merged version in Zé local

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md Zé solves conflictsze$ git add README.md add to Zé staging

ze$ git commit -m “add merge with…”

ze$ git push origin

create merged version in Zé local

ze$ edit README.md change in Zé workspacemia$ edit README.md change in Mia workspacemia$ git add README.md add to Mia stagingze$ git add README.md add to Zé stagingmia$ git commit -m “add Mia info" create version in Mia localmia$ git push origin create version in Mia remoteze$ git commit -m “add Ze info" create version in Zé localze$ git push origin error - your local version is outdatedze$ git pull origin merge remote version of Mia with

local version of Zéze$ edit README.md Zé solves conflictsze$ git add README.md add to Zé staging

ze$ git commit -m “add merge with…”

ze$ git push origin

create merged version in Zé local

create merged version in remote

Test Commands

http://git-school.github.io/visualizing-git/

https://try.github.io/levels/1/challenges/5

Further Resources• Software Engineering: Global Edition (10 Edition), Ian

Sommerville, chapter 25-1.

• Centralized workflow model: https://www.atlassian.com/git/tutorials/comparing-workflows/centralized-workflow

• Pro Git, Scott Chacon and Ben Straub.

• Git: http://git-scm.com/

• Eclipse EGit User Guide: http://wiki.eclipse.org/EGit/User_Guide