Code center > Suggestions
Call to Programmers
bacillus:
I've looked through the unit tests, sealed them off where I thought they were a bit dodgy.
The Chromosome idea seems brilliant to me; I assume that would mean that viruses bias the behaviour instead of rupturing it. It isn't foolproof though; it's easy enough to get around if the variable is amplified.
Numsgil:
Right, so I have to think about something better than just an average. Maybe weight the values somehow.
Numsgil:
I'm looking over the changes to the source code you made. Just a quick couple of notes:
1. In the random tests, rnd should never return 10. The range should be 0 to 9, or -9 to 0. Also add a TODO note: at some point I'll implement a way to seed the random number generator with a specific value, and the rand calls will be deterministic, which will make them easier to test.
2. I like that you added some extra fizzles tests.
3. In int ParseLabel(string word, DNA dna), change the function to look like this: bool ParseLabel(string word, ref int value, DNA dna), and have it return true or false depending on if the value was successfully parsed. And then remove the try/catch block in the function below it and introduce something that checks for true/false. We want to avoid the case where unknown labels get parsed to 0. If a label really is unknown, it's a typo on the user's part, and we should be able to catch that and produce a warning or error message for them so they know right away.
Keep at it I'm impressed how quickly you've figured out the unit tests.
bacillus:
I often use the Java version of it, JUnit. It amazed me to see how similar C# and Java are to each other, especially in this regard.
Numsgil:
Yeah, I think Microsoft realized that Java was pretty good, but that they'd never have creative control of the language, so they invented their own. I get the impression that Microsoft has a bit of "it wasn't invented here" syndrome going on. DirectX vs. OpenGL being a good example. But they usually do good work after the third or fourth version release, so I guess it all works out for the consumers in the end.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version