1 / 24

Testing Telecoms Software with QuickCheck

Testing Telecoms Software with QuickCheck. Thomas Arts John Hughes Chalmers/ITU. Joakim Johansson Ulf Wiger Ericsson. Session Border Gateway. Monitors signalling traffic; opens and closes pinholes. 2x1G Ethernet Linux ”blade” processor. Media Gateway Controller.

alima
Download Presentation

Testing Telecoms Software with QuickCheck

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Testing Telecoms Software with QuickCheck Thomas Arts John Hughes Chalmers/ITU Joakim Johansson Ulf Wiger Ericsson

  2. Session Border Gateway Monitors signalling traffic; opens and closes pinholes 2x1G Ethernet Linux ”blade” processor Media Gateway Controller Opens media pin-holes for calls in progress Media Proxy 2x10G Ethernet Hardware for packet forwarding

  3. Session Border Gateway Media Gateway Controller ITU standard protocol H.248 (Megaco) Media Proxy 150KLOC Erlang 1.5MLOC C

  4. A QuickCheck Property prop_reverse() -> ?FORALL(Xs,list(int()), lists:reverse(lists:reverse(Xs)) == Xs). 6> eqc:quickcheck(rev:prop_reverse()). .................................................................................................... OK, passed 100 tests true

  5. A Wrong Property prop_reverse_wrong() -> ?FORALL(Xs,list(int()), lists:reverse(Xs) == Xs). 10> eqc:quickcheck(rev:prop_reverse_wrong()). .....................Failed! After 22 tests. [-2,4,0] Shrinking......(6 times) [1,0] false

  6. Testing the Media Proxy Control Software Send random command sequences Generate random messages in a random command sequence But not completely random! QuickCheck Media Proxy Check the responses

  7. Message Example: ASN.1 Description • A media descriptor contains a list of streams MediaDescriptor ::= SEQUENCE { termStateDescr TerminationStateDescriptor OPTIONAL, streams CHOICE { oneStream StreamParms, multiStream SEQUENCE OF StreamDescriptor } OPTIONAL, … }

  8. …with IWD Restrictions • A media descriptor contains a list of streams MediaDescriptor ::= SEQUENCE { termStateDescr TerminationStateDescriptor OPTIONAL, streams CHOICE { oneStream StreamParms, multiStream SEQUENCE OF StreamDescriptor } OPTIONAL, … }

  9. QuickCheck Generator for Erlang Records mediadescriptor(Streams) when Streams=/=[]-> {mediaDescriptor, #'MediaDescriptor'{ streams = case Streams of [{Id,Mode}] -> oneof([{oneStream,streamParms(Mode)}, {multiStream,[stream(Id,Mode)]}]); _ -> {multiStream, [stream(I,M) || {I,M}<-Streams]} end}}. stream(I,Mode) -> #'StreamDescriptor'{ streamID = I, streamParms = streamParms(Mode)}. Generators can be embedded in any data structure Message construction Logic from the IWD QuickCheck

  10. Local Control Descriptors StreamParms ::= SEQUENCE { localControlDescriptor LocalControlDescriptor OPTIONAL, localDescriptor LocalRemoteDescriptor OPTIONAL, remoteDescriptor LocalRemoteDescriptor OPTIONAL, …, statisticsDescriptor StatisticsDescriptor OPTIONAL }

  11. Two Cases: With and Without Remote Media Random boolean with high probability streamParms(Mode) -> ?LET(RemoteMediaDefined, probably(), if RemoteMediaDefined -> #'StreamParms'{ localControlDescriptor = localControl(Mode), localDescriptor = localDescriptor(RemoteMediaDefined), remoteDescriptor = remoteDescriptor(RemoteMediaDefined)}; true -> …… end).

  12. Megaco Commands Context Context

  13. Megaco Commands Context Context Context Termination Add Returns Context ID & Termination ID

  14. Megaco Commands Context Context Uses context ID Add Context Termination Termination

  15. Megaco Commands Context Context Context Termination Termination Modify Stream Stream Uses termination ID

  16. Megaco Commands Context Context Subtract Context Termination Termination Stream Stream

  17. Megaco Commands Context Context Context Termination Subtract Stream Stream

  18. Megaco Commands Context Context

  19. Symbolic Test Cases • Generated wrt an abstract state machine tracking contexts, terminations & streams [{set,1,…,send_add, [?choose_cxt_id,Streams,Req]}, {assert,…,check_add,[{var,1}], {set,2,…,send_add, [{call,…,get_reply_cxt,[{var,1}]}, Streams2,Req2]}, {assert,…,check_add,[{var,2}]}]

  20. Encode/Decode Error • Recall the stream parameters… StreamParms ::= SEQUENCE { localControlDescriptor LocalControlDescriptor OPTIONAL, localDescriptor LocalRemoteDescriptor OPTIONAL, remoteDescriptor LocalRemoteDescriptor OPTIONAL, …, statisticsDescriptor StatisticsDescriptor OPTIONAL }

  21. Add/Modify Error Add Modify

  22. Add/Subtract Error • There one day, gone the next… Add Subtract

  23. Add/Add/Modify Error • If the terminations have different numbers of streams Add Add Modify

  24. Add/Add/Sub/Add… Error • Extracted from a test case 160 commands long Add Add Add Subtract Subtract Add Subtract

More Related