Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH...

24
Chair of Software Engineering Robotics Programming Laboratory Bertrand Meyer Jiwon Shin Andrey Rusakov Software Engineering Tools

Transcript of Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH...

Page 1: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

Chair of Software Engineering

Robotics Programming Laboratory

Bertrand MeyerJiwon Shin

Andrey Rusakov

Software Engineering Tools

Page 2: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

2

A Story of a Woodcutter

...

-“I must be losing my strength”, the woodcutter

thought.

- “When was the last time you sharpened your

axe?” the boss asked.

- “Sharpen? I had no time to sharpen my axe.

I have been very busy trying to cut trees…”

Page 3: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

3

Engineering Tools

Why do we use tools?

Because things we usually create are complicated and with

tools we can create them easier.

Page 4: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

4

Software Engineering definition

SE - the multi-person construction of multi-version software

(David Parnas, 1975)

Page 5: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

5

Benefits of Using Tools

Tools

• Minimize time of routine operations

• Minimize human factor

• Provide more information about the system

• Provide more information about the process

Page 6: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

6

Which SE tools do you use?

Page 7: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

7

Text editors vs. IDEs

IDEs provide:

• Syntax highlighting/checking

• Auto completion

• Feature “navigation” (e.g. Go to the definition)

• Refactoring tools (see following slides)

General purpose text editors can also offer some of these features!

One of the main advantages of using general purpose text editor: you

don’t have to install any additional software to start writing your code.

Page 8: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

8

Refactoring

Code refactoring is a "disciplined technique for

restructuring an existing body of code,

altering its internal structure

without changing its external behavior"

Page 9: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

9

Refactoring techniques

Techniques that allow for more abstraction Encapsulate Field Generalize Type Replace type-checking code with State/Strategy Replace conditional with polymorphism

Techniques for breaking code apart into more logical pieces Componentization Extract Class Extract Method

Techniques for improving names and location of code Move Method or Move Field Rename Method or Rename Field Pull Up Push Down

Page 10: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

10

Refactoring Tools: Examples

Integrated refactoring tools:

• Eclipse

• NetBeans

• MS VisualStudio

• EiffelStudio

ReSharper

Page 11: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

11

Debuggers

Integrated debuggers:

• EiffelStudio

• MS VisualStudio

• Eclipse

GDB (GNU Debugger) – a command-line debugger for several languages,

including C and C++

DDD (Data Display Debugger) - is a graphical front-end for command-line

debuggers such as GDB

Valgrind (memory debugger)

Page 12: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

12

Profilers & Performance analyzers

Integrated profilers

• Eclipse

• MS VisualStudio

• NetBeans

• EiffelStudio

Intel VTune

Page 13: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

13

Testing

Unit testing

• JUnit

• NUnit

• CppUnit

• Autotest

GUI testing

• Selenium (web applications)

Testing multi-threaded applications

• ConTest

Page 14: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

14

Test-Driven Development

TDD cycle:

• Add a test

• Run all tests and see if the new one fails

• Write some code

• Run tests

• Refactor code

• Repeat

Page 15: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

15

EiffelStudio

DEMO

Page 16: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

16

Version control

SVN

Git

Mercurial

Page 17: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

17

Ivan’s machineDasha’s machine

SVN

SVN server

Repository

CommitCommitUpdate Update

Local working copy Local working copy

Page 18: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

18

SVN basics

Common terms:

• Diff

• Revision

• Branch

• Merge

Commands:

• checkout

• add

• remove

• update

• revert

• diff

• commit

Page 19: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

19

Dasha’s machine

Git

Local repository

Git server

Remote repository

PushPushPull Pull

Local working copy

Ivan’s machine

Local repository

Local working copy

Commit Reset Commit Reset

Page 20: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

20

Git basics

Git workflows:

• Centralized

• Feature Branch

• Gitflow

• Forking

• ...

Commands:

• clone

• add

• rm

• status

• pull

• commit

• push

Page 21: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

21

Bug trackers, Issue trackers

JIRA

Bugzilla

Redmine

Trac

Jazz

Page 22: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

22

Build tools

Ant

Maven

Cmake

Page 23: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

23

Continious Integration

Jenkins

Teamcity

Page 24: Bertrand Meyer Jiwon Shin Andrey Rusakov - ETH Zse.inf.ethz.ch/courses/2015b_fall/rpl/lectures/03_Software... · Chair of Software Engineering Robotics Programming Laboratory Bertrand

24

Object-oriented analysis and design

BON

UML