Comments (7)
Note to self: TuiTextBox LineInfo should be tested when this is implemented.
from djehuty.
The framework cannot be responsible for private behaviors of the packages, only that the public behaviors are consistent with package implementations. The tests are simply to allow others to re-implement packages or classes with the same interface and then have the same tests imposed upon them across the framework to see if they function.
Tests are done external to the class for a reason: you don't want to have to change the test when you update the implementation. Private behaviors are so incredibly tied to a class that it is always difficult to test them.
If correct behavior of LineInfo can be ascertained through the correct behavior of the TuiTextBox, then that is certainly fine. A test member function exposed through a class is also fine, but it probably shouldn't be exposed as 'public', but rather as 'package' and called from a separate test module within the package.
Overall, private behaviors tell you nothing about the certifiable state of the program. Assume correctness of private behaviors. Produce some code in TuiTextBox that also assumes correctness and produces some public behavior. Test this code instead.
from djehuty.
Produce some code in TuiTextBox that also assumes correctness and produces some public behavior. Test this code instead.
The resulting behaviour is interactive, so I can't think of an automated way to test it.
from djehuty.
When testing, you only care about external behaviors. If you tried to test private behavior, you'd be violating encapsulation, amongst other things. If you get the correct answer, how could internal stuff be 'wrong?'
from djehuty.
It could be correct for the cases that are used internally, but fail for cases which are not used internally now but may be in the future.
from djehuty.
So you're going to test for everything that might be possibly true in the future?
Good luck.
from djehuty.
Steve's right. You can only account for the cases you acknowledge. So...
It could be correct for the cases that are used internally, but fail for cases which are not used internally now but may be in the future.
In this case, we would add specifications to account for additional features (features in this context are ALWAYS public behaviors... so ignore "performance" features which are tested differently), and those additional tests should catch the error and help reduce the case for the cause.
Not catching the error in the public behavior is our fault. Not having a test that would cover internal behavior is OK if the flaw is never exercised. Sounds icky, but it is actually fiiiine. What you are really worried about is passing a bad piece of data to another class (where flawed data propagation is a factor of class cohesion properties). So that is what you test for.
from djehuty.
Related Issues (19)
- ArrayList to List HOT 1
- Pops can be heard when playing MP3s
- JPEG image decoder does not work for progressive images.
- JPEG decoder does not work for images that are not a factor of the block size.
- DSpec does not build HOT 1
- TuiTetris does not build HOT 1
- OSX Support is broken HOT 1
- FTP (Client) Not Implemented HOT 1
- Specification Tests not written for Core
- Specification Tests not written for Resource
- Method to build apps through automation not developed
- Specification Tests not written for Utils HOT 2
- Method to split up sections or packages of the framework not implemented. HOT 2
- Method to document for developers has not been developed
- Method to document for users has not been developed
- runtest segfaults HOT 3
- Expected/actual values for tests HOT 3
- OS X is slow HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djehuty.