Archive for the ‘session’ Category
testing, states, comparison
Repeatable test means that you can build up the _same_ starting state and run the _same_ test cases with the _same_ test tools configured the _same_ way. Even if you have random simulations, you should be able to reset the random seed.
It can happen that you cannot use the same starting state in your project, because it is around a terabyte (a database containing transactions and their history). You can’t step twice into the same database : ) Some sort of justification can be that this big state is an aggregate state. So a given test case depends only on its close environment. In this case though, the locality of these environments should be documented.
It can happen that the schema of the database changes and because of this, some of the numerous test cases are modified during the regression tests. But not all the ones that depend on the old schema (or on the schema in general). Years later nobody knows what the hell is going on when testing with those old cases. Either about the way they should be fixed.
By the way, don’t represent the cases in MS Access databases. In case you want to understand the evolution of a test case (e.g. along with the evolution of the database schema) by looking through the versioned history of their representation, that’s quite time consuming because there aren’t any good tools to diff MS Access databases.
I’m not sure though, that teaching people comparable textual representations worth it in contrast to not comparable wysiwyg editor based information forms. A solution can be a wysiwyg solution with predictable and _not_ verbose export functionality. For example pg_dump and pgadmin as GUI:
% pg_dump -s | grep -v ^-- > dbscm1.sql % psql -q => create table zfoo (a serial primary key, c numeric check (c > 0)); NOTICE: CREATE TABLE will create implicit sequence "zfoo_a_seq" for "serial" column "zfoo.a" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zfoo_pkey" for table "zfoo" => \q % pg_dump -s | grep -v ^-- > dbscm2.sql % diff dbscm1.sql dbscm2.sql 270a271,278 > CREATE TABLE zfoo ( > a serial NOT NULL, > c numeric, > CONSTRAINT zfoo_c CHECK ((c > (0)::numeric)) > ); > > > 340a349,353 > ALTER TABLE ONLY zfoo > ADD CONSTRAINT zfoo_pkey PRIMARY KEY (a); > > > %
rebuild cffi foreign bindings
C:\grault>type lib-foo.c
int getone ()
{
return 1;
}
C:\grault>gcc -shared -o lib-foo.dll lib-foo.c
C:\grault>clisp -q -norc -i ..\.clisprc
;; Loading file ..\.clisprc ...
[1]> (setf *load-verbose* nil)
NIL
[2]> (asdf:oos 'asdf:load-op :cffi :verbose nil)
#<ASDF:LOAD-OP (:VERBOSE NIL) #x19C29B55>
[3]> (cffi:load-foreign-library "lib-foo")
#<CFFI::FOREIGN-LIBRARY #x19CCE065>
[4]> (cffi:defcfun "getone" :int)
GETONE
[5]> (getone)
1
[6]> (ext:saveinitmem "foo.mem" :norc t)
Bytes permanently allocated: 92,512
Bytes currently in use: 3,409,664
Bytes available until next GC: 852,166
3409664 ;
852166 ;
92512 ;
38 ;
20303572 ;
2808018
[7]> (quit)
C:\grault>dir/b
foo.mem
lib-foo.c
lib-foo.dll
C:\grault>clisp -q -M foo.mem
[1]> (getone)
WARNING: FFI::FIND-FOREIGN-FUNCTION: no dynamic object named "getone" in library :DEFAULT
*** - FUNCALL: undefined function NIL
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of (FDEFINITION 'NIL).
RETRY :R2 Retry
STORE-VALUE :R3 Input a new value for (FDEFINITION 'NIL).
ABORT :R4 Abort main loop
Break 1 [2]> :r4
[3]> (cffi:use-foreign-library "lib-foo")
#<CFFI::FOREIGN-LIBRARY #x19FB66AD>
[4]> (getone)
1
[5]> (quit)
C:\grault>