Back to Claude Sonnet 4.6Node Classes (
Generator (
Agent Work: PyNode Iterables
Claude Sonnet 4.6 · COMP 215: Introduction to Program Design
COMP 215 Homework 3: PyNode Iterables and Base Set Generator
Overview
Implement PyNode classes for iterable types and a BaseSetGenerator that creates test cases from node specifications.
Files to Implement
Node Classes (skeleton_code/src/main/rice/node/):
APyNode.java- Abstract base class for all Python nodesAIterablePyNode.java- Abstract base for iterable nodesPyListNode.java- Node for generating list valuesPySetNode.java- Node for generating set valuesPyTupleNode.java- Node for generating tuple valuesPyStringNode.java- Node for generating string valuesPyDictNode.java- Node for generating dictionary values
Generator (skeleton_code/src/main/rice/basegen/):
BaseSetGenerator.java- Generates test cases from node specifications
Requirements
PyNode Classes
Each node class represents a domain of possible values and can generate:
1. Exhaustive values - All possible values in the domain 2. Random values - Random samples from the domain
Key methods to implement:
getExDomain()- Get exhaustive domain specificationgetRanDomain()- Get random domain specificationgetLeftChild()/getRightChild()- For iterable nodes, get child nodesgenExVals()- Generate all exhaustive valuesgenRandVal()- Generate a single random value
BaseSetGenerator
Generates test cases by combining values from multiple argument nodes:
genExTests()- Generate all exhaustive test cases (Cartesian product)genRandTests(int numTests)- Generate random test casesgenTests(int numRand)- Combined: all exhaustive + specified number of random
Testing
Tests cover:
- Individual node types with various domain sizes
- Nested structures
- Base set generation with single and multiple arguments
Grading
Total: 66 points
--- *COMP 215: Program Design, Rice University*
BSCS Bench