I'm trying to practice BDD by applying it to a simple problem—in this case, the flocking algorithm, better known as "boids".
Before any of the rules (cohesion, alignment, etc.) comes the most fundamental behavior: movement. The rules mutate a boid's velocity, but that means nothing unless the velocity mutates the boid's position.
Should I define an acceptance test for it?
Feature: Movement Scenario: Updating position according to velocity. Given a boid, When it moves, Then its new position should be the sum of its old position and its velocity. On one hand, this is a critical piece of functionality without which the rest of the software falls apart. On the other, the logic is dead simple vector addition, and the test code would be equivalent to the code it's testing.
// The test: assert_equal(old_position + velocity, new_position) // The code under test: self.position += self.velocity Is there any point to such a test?