Skip to content

Instantly share code, notes, and snippets.

@Descalon
Last active October 10, 2019 12:18
Show Gist options
  • Save Descalon/aa76716d2c940b8a44dcb014dde6795f to your computer and use it in GitHub Desktop.
Save Descalon/aa76716d2c940b8a44dcb014dde6795f to your computer and use it in GitHub Desktop.
Poging tot een deur
timeout 0.5
external 'door'
function('min', [] => :integer) {1000}
function('max', [] => :integer) {9999}
process ('door'){
channel ('door') {
stimuli 'open', 'close'
responses 'opened', 'closed', 'locked', 'unlocked', 'invalid_command', 'invalid_passcode', 'incorrect_passcode', 'shut_off'
stimulus 'lock', 'passcode' => :integer
stimulus 'unlock', 'passcode' => :integer
}
var 'code', :integer
var 'tries', :integer, 1
state 'closed'
choice {
o { receive 'open'; send 'opened'; goto 'opened' }
o { receive 'close'; send 'invalid_command'; goto 'closed'}
o { receive 'lock', constraint: 'passcode < min() || passcode > max()'; send 'invalid_passcode'; goto 'closed'}
o { receive 'lock', constraint: 'passcode >= min() && passcode <= max()', update: 'code = passcode'; send 'locked'; goto 'locked'}
o { receive 'unlock', constraint: 'passcode == passcode'; send 'invalid_command'; goto 'closed'}
}
state 'opened'
choice {
o { receive 'close'; send 'closed'; goto 'closed'}
o { receive 'open'; send 'invalid_command'; goto 'opened' }
o { receive 'lock', constraint: 'passcode == passcode'; send 'invalid_command'; goto 'opened' }
o { receive 'unlock', constraint: 'passcode == passcode'; send 'invalid_command'; goto 'opened' }
}
state 'locked'
choice {
o { receive 'unlock', constraint: 'passcode < min() || passcode > max()'; send 'invalid_passcode'; goto 'locked'}
o { receive 'unlock', update: 'tries = 1', constraint: 'passcode == code'; send 'unlocked'; goto 'closed'}
o { receive 'unlock', constraint: 'tries < 3 && (passcode >= min() && passcode <= max()) && passcode != code ', update: 'tries = tries + 1'; send 'incorrect_passcode'; goto 'locked'}
o { receive 'unlock', constraint: 'tries > 2 && (passcode >= min() && passcode <= max()) && passcode != code'; goto 'stop'}
o { receive 'lock', constraint: 'passcode == passcode'; send 'invalid_command'; goto 'locked'}
o { receive 'open' ; send 'invalid_command'; goto 'locked'}
o { receive 'close'; send 'invalid_command'; goto 'locked'}
}
state 'stop'
send 'incorrect_passcode'
send 'shut_off'
}

AML Report

Spec findings

  • Most SUTs implement a response shut_off that is not specified. If this was a singular case - only one SUT had this response - then I'd regard it as an anomaly, but (for now) the count is 3.

Besto

  • Locking while locked should give a !invalid_command but SUT sends !locked
  • Implements !shut_off

Logica

  • Closing while closed should give a !invalid_command but SUT sends !closed
  • Opening while opened should give a !invalid_command but SUT sends !opened
  • SUT does not implement !shut_off

OnTarget

  • All tests pass
  • Implements !shut_off

quickerr

  • Accepts incorrect passcodes (locked with 3, unlocks with 1)

SmartSoft

  • Door does not respond within time limit
  • Implements !shut_off

TrustedTechnologies

  • ?close doesn't result in !closed
  • Accepts invalid passcode on lock and unlock
  • Implements shut_off

univerSolutions

  • SUT counts invalid passcodes as tries

XtraSafe

  • Only accepts passcodes > 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment