Canonical test cases?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Canonical test cases?

Dan Norton

On Mon, 23 Feb 2015 14:43:26 -0500

"Phil (list)" <pbpublist at gmail.com> wrote:


>> I started playing around with a couple of example test cases to see what

>> I ran into and came up with a distinct class to store all of these per

>> test category (i.e. under Test-Files a class ApiFile which could have a

>> method testWriteTextFile)  The rationale was that it might make sense to

>> keep these test cases separate from traditional test cases which are

>> free to make calls that users of the class (i.e. who are calling the

>> supported API) should not.


>You bring up a good point.


>I suspect there are three basic cases:

>  [1] A number of small test cases for a wide, shallow API.  E.g. Collection classes.  Many "small" usage tests.

>  [2] A few deep calls which demonstrate a usage protocol.  E.g. open/read/close files, sockets; use library wrapper.

>  [3] Sample/example UI code which illustrate how to build apps/applets/tools  [Color Picker, File List, ..]


>A test class, as you point out, is probably appropriate for case [1], where there would be a zillion >test<collection><access>API kinds of things would swamp a name search.  A class naming convention would be good here.


>Individual test methods, with a searchable name convention, would be best for [2] where there would be few illustrative usage tests.


>We could call out example code in a README doc for [3] where examples might have auxiliary architectural documentation.


It just so happens that I've been looking at porting the terse guide from Squeak and that effort may have some bearing on the above. The Squeak terse guide brings with it the help manager and therefore a lot of stuff requiring rewrites. However, a much lighter weight and more readable version can be had by using the existing facilities of Cuis. What you see when you open a topic is code which has the same appearance as in a browser. I'm still wrangling a UI for it, but as it stands you can do:

    TerseGuideHelp display: #<topic>

to see a Workspace with the text presented by SmalltalkEditor. <topic> is from #pages in the Squeak guide.


- Dan Norton

 

  

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Canonical test cases?

Juan Vuletich-4
On 2/25/2015 2:36 PM, Dan Norton wrote:

On Mon, 23 Feb 2015 14:43:26 -0500

"Phil (list)" <pbpublist at gmail.com> wrote:


>> I started playing around with a couple of example test cases to see what

>> I ran into and came up with a distinct class to store all of these per

>> test category (i.e. under Test-Files a class ApiFile which could have a

>> method testWriteTextFile)  The rationale was that it might make sense to

>> keep these test cases separate from traditional test cases which are

>> free to make calls that users of the class (i.e. who are calling the

>> supported API) should not.


>You bring up a good point.


>I suspect there are three basic cases:

>  [1] A number of small test cases for a wide, shallow API.  E.g. Collection classes.  Many "small" usage tests.

>  [2] A few deep calls which demonstrate a usage protocol.  E.g. open/read/close files, sockets; use library wrapper.

>  [3] Sample/example UI code which illustrate how to build apps/applets/tools  [Color Picker, File List, ..]


>A test class, as you point out, is probably appropriate for case [1], where there would be a zillion >test<collection><access>API kinds of things would swamp a name search.  A class naming convention would be good here.


>Individual test methods, with a searchable name convention, would be best for [2] where there would be few illustrative usage tests.


>We could call out example code in a README doc for [3] where examples might have auxiliary architectural documentation.


It just so happens that I've been looking at porting the terse guide from Squeak and that effort may have some bearing on the above. The Squeak terse guide brings with it the help manager and therefore a lot of stuff requiring rewrites. However, a much lighter weight and more readable version can be had by using the existing facilities of Cuis. What you see when you open a topic is code which has the same appearance as in a browser. I'm still wrangling a UI for it, but as it stands you can do:

    TerseGuideHelp display: #<topic>

to see a Workspace with the text presented by SmalltalkEditor. <topic> is from #pages in the Squeak guide.


- Dan Norton


Please share this even if incomplete. If you need help with the GUI or anything, ask for it.

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Canonical test cases?

Dan Norton
On 26 Feb 2015 at 11:19, Juan Vuletich wrote:

>
> On 2/25/2015 2:36 PM, Dan Norton wrote:
(snip)

>
> It just so happens that I've been looking at porting the terse guide
> from Squeak and that
> effort may have some bearing on the above. The Squeak terse guide
> brings with it the
> help manager and therefore a lot of stuff requiring rewrites.
> However, a much lighter
> weight and more readable version can be had by using the existing
> facilities of Cuis.
> What you see when you open a topic is code which has the same
> appearance as in a
> browser. I'm still wrangling a UI for it, but as it stands you can
> do:
>     TerseGuideHelp display: #<topic>
> to see a Workspace with the text presented by SmalltalkEditor.
> <topic> is from #pages in
> the Squeak guide.
>
> - Dan Norton
>
> Please share this even if incomplete. If you need help with the GUI
> or anything, ask for it.
>
> Cheers,
> Juan Vuletich

OK it's on the way, warts and all. It was a pleasure to watch non-essential things fall away as
this was ported. That is due to the elegance of Cuis.

I'm trying to have text pane contents appear the same as they do in a Workspace. The editor
for the text pane is SmalltalkEditor but the effect is TextEditor. Any help would be
appreciated.


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Canonical test cases?

Juan Vuletich-4
On 2/26/2015 7:26 PM, Dan Norton wrote:
> ...
> OK it's on the way, warts and all. It was a pleasure to watch non-essential things fall away as
> this was ported. That is due to the elegance of Cuis.
>
> I'm trying to have text pane contents appear the same as they do in a Workspace. The editor
> for the text pane is SmalltalkEditor but the effect is TextEditor. Any help would be
> appreciated.

The key is to use a Workspace as the model. Browse class Workspace for
the kind of services it provides. To see how it is put together, debug
"Workspace openLabel: 'a workspace'", The Workspace class comment might
also be useful.

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org