Code Monkey home page Code Monkey logo

ntable's Introduction

NTable Testbench

A simple stimulus pattern generator, with checking, to test a scheme implementation of a table data structure where values are stored under a varying number of keys.

Exercise 3.25 SICP1 1st & 2nd Ed

Generalizing one- and two-dimensional tables, show how to implement a table in which values are stored under an arbitrary number of keys and different val- ues may be stored under different numbers of keys. The lookup and insert! procedures should take as input a list of keys used to access the table.

How to generate the self-checking stimulus

At the shell prompt ./nttest >stim

Restrictions and Caveats

Peruse the generated stimulus to see what, if any, changes need to be made to the exported procedures of the implementation under test (IUT) to align with what the stimulus uses. Small shim procedures may be required.

The IUT must return #f upon an unsuccessful lookup. FYI, SICP 1st Edition returned nil.

The object #f is never used as an element in the keylist, but there is no reason why not.

Methodology

Randomize the objects to be inserted into the table, the number and objects of the key(s), and the insertion order. Insert these (key(s),value) tuples into two distinct tables. Finally, check in random order against a reference model that all table entries retain the correct value previously inserted. Augment with many additional unsuccessful lookups sprinkled throughout.

Verification

The testbench was verified on Linux using these scheme implementations

  1. s9 Scheme 9 from Empty Space by Nils M Holm, 2018-12-05
  2. mit-scheme Release 10.1.11 || Microcode 15.3 || Runtime 15.7
  3. racket v7.9 [bc]

See Also

Footnotes

  1. Structure and Interpretation of Computer Programs by Harold Abelson et al. 1985, 1996 โ†ฉ

ntable's People

Contributors

roytobin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.