Draft! This page is a draft - a work in progress!

Sketches - declarative prototyping Subscribe Pub Share

The most abstract and simple way to create a program would be if we specified the required outputs or rules about the required outputs for given inputs and have the language/environment do the rest.

Prolog would come to mind.

Wouldn't it be grand? I mean we do have to specify most of it when creating the specifications and acceptance testing anyway, right?

Check this fiddle out for a second. You see a simple expectation, but if you switch to the trace tab or click on the REST link, you see that you, in fact, get the value you just said you expect.

$send say.hi (name = "Jane")
$expect (greeting contains name)

Do we really have to write the implementation for say.hi ? Nope! Does it do what we expect? Well, sort of...

Sketching

There is a special engine mode sketchMode which will basically instruct the engine to sketch the expected values (i.e. fake them), if no other rules or mocks are found.

The tests should always pass in this case, since they were the ones providing the values.

Does the service do what is expected? Well... to the extent to which there are no conflicting expectations.


Was this useful?    

By: Razie | 2017-05-30 .. 2019-10-16 | Tags: post , story


See more in: Cool Scala Subscribe

Viewed 821 times ( | History | Print ) this page.

You need to log in to post a comment!