• No results found

Software Maintenance Competences

N/A
N/A
Protected

Academic year: 2022

Share "Software Maintenance Competences"

Copied!
17
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Software Analysis And Transformation

Software Maintenance Competences

Jurgen J. Vinju

NWO-I Centrum Wiskunde & Informatica TU Eindhoven

Swat.engineering

(2)

Source Code Complexity

Source Complexity results from tangling four code dimensions Domain Complexity x Domain Evolution x

Technical Complexity x Technical Evolution

do ma in kno wled ge technical

knowledge

technical evolution

domain evolution

technical evolution

software starts simple

and flexible and then gradually grows into

a big knot which is hard

to maintain

(3)

Software Maintenance

Design stage

System architecture is designed

Reversible design decisions

Short term successes

Testing is easy

Growth stage

Incremental additions and corrections grow

Misconceptions and haste lead to design erosion

Co-evolution: changes become scattered

“Accidental” code, when it works -> commit

Testing becomes cumbersome

Stagnation stage

Changes break the system; increasing focus on analysis

Working on bugs rather than features

“How did this ever work”?

Critical reading pushes out (creative) writing

Early Benefits of software ownership

Tactical advantage: fast time-to-market

Short horizons

Incremental costs

Growing Cost of software ownership

Lower margins over time

Increasing maintenance costs

Cost of replacement out-weighs the ROI

Inevitable Risks of software ownership

Software becomes cause of stagnation

Employee turn-over rate too high

Cost of maintenance outweighs total value

Engineering Business

“changing source code after the initial release”

(4)

Source Code Maintenance:

Necessary but Challenging

port

to Lin ux switch to ARM

add WWW interfa ce

add li ve us feed er

back

integ rate 3D sim ulati on

upgrade

to Windo ws 10 from Wind ows 95

certify GDPR compliance

merge this acquired

software

“stack” into our own, wi th

backward compatibility

fix performance bottleneck for peek

user loads

add live user feed back

scale to

{giga,tera,peta throughput }byte/s

(5)

attitude

kno wled

ge ski ll

Engineering Viewpoint

Business Viewpoint

Tool Support Viewpoint

Software Maintenance Competences

(6)

attitude

kno wled

ge ski ll

Engineering Viewpoint

Business Viewpoint

Tool Support Viewpoint

Goals of Software Maintenance

1. prevent sky rocketing costs 2. enable strategic maintenance 1. do better and faster maintenance

2. extend life-time of legacy code

1. make code analysis a “humane” task 2. enable large scale restructuring

[tudor girba/feenk.com]

(7)

Business Attitudes

I want to motivate good software maintenance by evaluating maintenance:

• New KPI’s measure costs and benefits of maintenance

I want to invest in Preventive Maintenance

• Because maintainable software is flexible software

• I know that high-quality (=maintainable) software does not come for free

• Engineers have to invest in software quality

• Before they can offer agility

• I want to explain my requirements precisely

Use Bette Key Perf orma r

Indica tors nce Plan fo r ma intena maintena nce:

nce now = futur

e ROI Appr eciate Softw

are Q

uality

(8)

Grow Business Knowledge

• “I know my business”: model business complexity independently, e.g:

image algorithms vs {SIMD,GPU,FPGA} instructions

documented protocols vs inter-process communication library calls

telemetry and control state machines vs code design patterns

Model Driven Engineering benefits start with domain knowledge

benefits: early feedback (verification, simulation)

benefit: code generation

benefit: independent evolution: domain & technology untangle

domain

design

(9)

Learn New Business Skills

• I can “measure maintenance quality (contra)-indicators”

growth of volume & complexity

issues: registration and resolution of maintenance tasks, …

versions: locality of change, commit coherence, …

tests: coverage (branches) and quality (mutant score)

• I can “author executable domain models”

lightweight formalization of requirements

(interactively) simulate, explore, test, verify software products before implementation

evolve domain models to address new business opportunities

predict impact of business changes on technology stack

metrics that make sense

MDE experimentation

= understanding

(10)

Need business tools

• I need tailor-made modeling, simulation, validation tools

• I need tools to measuring maintenance quality and productivity

• Off-the-shelf is _not_ the answer

• domain knowledge is contextual

• maintenance quality is contextual

• Rascal is a metaprogramming language for tailor-made software analysis and manipulation tools.

accuracy requires context

(11)

Engineering attitudes

I think analyzing software puzzles is interesting

I own the maintenance of this legacy code

I want to automate analyses and transformations

Maintena

is my job nce

and I lik e it

(12)

Increase engineering knowledge

• I understand the programming language and the OS

I understand code-as-data: AST, CG, PDG, SDG

I know our domain independent from our code

untangle

domain

(13)

Learn new engineering skills

• “I can automate analysis tasks”:

• Write tailor-made source code analysis queries (code-to-model)

• Map models to existing analysis platforms (SMT, PDE,

• “I can automate refactoring tasks”

• Writing source-to-source transformations (code-to-code)

• “I can automated software construction tasks”

• I can separate domain knowledge from code design knowledge

• I can write source code generators (model-to-code)

going meta

Rascal is for easily writing meta programs

(14)

Need new engineering tools

Need API for handling programming language complexity

• code-as-data: syntactic and semantic intermediate models

• query/expression: pattern matching, relational queries, templates

• Need ability to encode domain knowledge and design knowledge

• A “one-stop-shop” meta-programming language: Rascal

(15)

Rascal MPL

Comprehensive metaprogramming language

• For creating tailor-made modeling and analysis tools

• For creating analysis, transformation and generation tools

• Same functionality in ±10% of lines of code

(Inter)National Community:

Research: incorporates results from 1982 to 2021

Education: UvA, TUE, RUG, OU, ECU, Bergen

Business:

Support

Languages: Java, C++, C#, PHP, JS, JVM bytecode, …

Analysis: SMT, Relational Algebra, State Machines

UI: Eclipse, VScode (LSP), Commandline Interface

Track record: Philips Healthcare, ING, OCÉ, NFI, SIDN, Stokhos, EU Typhon, EU CROSSMINER, EU OSSMETER, …

Code/Data

Model

Picture

Generation Extraction

Formalization Visualization

Transformation

Conversion Analysis

Execution

Rendering

(16)

“E-A-SY” Rascal Example

Extract, Analyse, and SYnthesize

1. parse input code

module Syntax

extend lang::std::Layout;

extend lang::std::Id;

start syntax Machine = machine: State+ states;

syntax State = state: "state" Id name Trans* out;

syntax Trans = trans: Id event ":" Id to;

grammars

2. create “model”, transitive closure, and query

module Analyze import Syntax;

set[Id] unreachable(Machine m) {

rel[Id,Id] r = { <q1,q2> | (State) `state <Id q1> <Trans* ts>` <- m.states, (Trans) `<Id _>: <Id q2>` <- ts

}+;

qs = [ q.name | /State q := m ];

return { q | q <- qs, q notin r[qs[0]] };

}

matching & query

module Visualize import Syntax;

import DagreD3;

void visualize(Machine m) {

edges = { edge("<q1>", "<q2>") | (State)`state <Id q1> <Trans* ts>` <- m.states, (Trans)`<Id _>: <Id q2>` <- ts };

nodes = { node(“<q.name>") | /State q := m };

showGraph(nodes, edges);

}

3. generate a visual representation

overviews

4. generate implementation

module Compile import Syntax;

str compile(Machine m) = "while (true) {

' event = input.next();

' switch (current) {

' <for (q <- m.states) {>

' case \"<q.name>\":

' <for (t <- q.out) {>

' if (event.equals(\"<t.event>\")) ' current = \"<t.to>\";

' <}>

' break;

' <}>

' } '}";

templates

(17)

attitude

kno wled

ge ski ll

Engineering Viewpoint

Business Viewpoint

Tool Support Viewpoint Conclusion

writing and using executable models and

implementing quality monitoring automating code/model analysis and

transformation, generation

enabling tailor-made MDE, reverse engineering and quality monitoring support models

mo del s mo del s

one stop meta shop

Rascal

@jurgenvinju

jurgen.Vinju@cwi.nl

j.j.vinju@tue.nl

Referenties

GERELATEERDE DOCUMENTEN

Our results suggest that three important implications in the snaking regime may be expected in microcirculation: (i) in stiff cells, deformation is significantly reduced, presenting

In the last section, we defined the Kolmogorov complexity of a binary string as the length of the shortest program for a universal computer that prints out

marking and are naturalized through explanations that seem plausible within the fictional.. At the same time, our example showed that the use of balancing mechanisms may lessen

Then, an alternative design was to be developed, which would have the same process and stakeholder complexity values as the basic design, but a higher value for network

Complexity is the keyword here, for superdiversity “on the ground” involves perpetual and very rapid social and cultural change involving the repositioning of groups and individuals,

This consists of (1) The GP effectively assess if a patient requires hospital diagnosis, (2) The GP is less effective in selecting an appropriate hospital, (3) The physician of

Veel zorgverleners kunnen redelijk inschatten of een patiënt in staat is besluiten te nemen, maar vaak wordt overschat op welk niveau een patiënt besluiten kan

Maar wie op zoek gaat met een burger naar een passende oplossing voor zijn probleem, stemt af op wat de ander werkelijk nodig heeft.. Te weinig hulp