%%{init: {'theme':'dark'}}%%
flowchart TD
A[IDEJA] --> B[SPECIFIKACIJA]
B --> C[KODA]
Writing is nature's way of letting you know how sloppy your thinking is.
- Richard Guindon (Michigan So Far)
%%{init: {'theme':'dark'}}%%
flowchart TD
A[IDEJA] --> B[FORMALIZACIJA]
B --> C[KODA]
... the purpose of abstracting is not to be vague, but to create a new semantic level in which one can be absolutely precise.
- Edsger W. Dijkstra (The Humble Programmer)
%%{init: {'theme':'dark'}}%%
flowchart TD
AA[Stranka] -->|REQUIREMENTS ENGINEERING| A
A[SPECIFIKACIJA] -->|ELABORATIONS| C[FORMALIZACIJA]
C -->|REFINEMENTS| E[KODA]
E --> AA
Kaj pa legacy code?
Traditional software engineering is primarily focused on the development and design of new software. However, most programmers work on software that other people have designed and developed.
- Nelson (A Survey of Reverse Engineering and Program Comprehension)
Povzetek
razmisli preden pišeš program
misli medtem ko bereš program
misli s pisanjem
veliko členov manjka, vsi imajo svojo teorijo
Alloy Analyzer
Kaj je Alloy Analyzer?
modelirni jezik
iskalnik primerov
Testiranje
Bounded model checking
Modeliranje v Alloyu
Kaj opiše Alloy model?
začetno stanje
prehod med stanji
omejitve celotnega izvajanja
Kako modeliramo stanje v Alloyu?
opišemo objekte
števnosti relacij med njimi
z logiko postavimo dodatne omejitve
Še ena perspektiva modeliranja
%%{init: {'theme':'dark'}}%%
flowchart TD
A[IDEJA] --> B[FORMALIZACIJA ZAHTEV KODE]
B --> C[FORMALIZACIJA DELOVANJA KODE]
C --> D[KODA]
Z sig deklariramo nov tip objekta
sig Object {}
Če jih je več so med seboj disjunktni
sig Object1 {}
sig Object2 {}
Opredelitev podmnožic
sig Object {}
sig A in Object {}
sig B in Object {}
Opredelitev disjunktne podmnožice
sig Object {}
sig A extends Object {}
sig B extends Object {}
Kako je z mešanjem?
sig Object {}
sig B in Object {}
sig A, C extends Object {}
Izločanje "drugih" elementov
abstract sig Object {}
sig A in Object {}
sig B in Object {}
Določanje števnosti množic
sig A {} // neopredeljeno število A-jev
one sig B {} // natanko en element B
some sig C {} // vsaj en element C
lone sig D {} // eden ali noben element D
KVIZ
sig C in A {}
abstract sig D in O {}
sig A, B extends O {}
abstract sig O {}
sig C in A {}
sig B extends O {}
abstract sig O {}
sig A extends O {}
sig B in A {}
sig C, D extends E {}
abstract sig E in A {}
abstract sig A {}
sig E in A {}
abstract sig A {}
abstract sig B in A {}
sig C, D extends E {}
Relacije med objekti
sig Webpage {
parent_page : lone Webpage,
link : set Webpage
}
Objekti podedujejo relacije
sig Person {
friend : set Person
}
sig Child in Person {}
Primer: Git object model
sig GitObject {
// hash : one Str
}
// sig Str {}
sig Commit extends GitObject {
// author, committer, msg : one Str,
parent : set Commit,
tree : one Tree
}
sig blob extends GitObject {
// content : one Str
}
sig tree in GitObject {
entry : set (Blob + Tree)
}