Added test file for mse and plot methods#2
Open
duffee wants to merge 2 commits into
Open
Conversation
|
Please don't use hardcoded files in the working directory, instead use |
Author
|
updated to use I hadn't spotted the Demos. Nice! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've added a test file to cover the
mseandplotmethods of your module. Devel::Cover reports the Total Coverage has increased from 55% to 85%. (I can upload the html coverage report if you want). You can include the new test 04-plot_fit.t if you find it useful.Since Perl is all about personal style, I'll explain where I've departed from your style and you can make up your own mind if it's good or not.
Line 14: I've used a closure or an anonymous sub instead of a subroutine and you can pass those around. Works the same and people seem to like them for some reason.
Line 37: I've used subtests to group logically connected tests. It also localizes scope so that your next set of tests is reset to a cleaner state.
Line 40: Is the Mean Squared Error really supposed to be zero? I've no idea and is probably correct on a simple fit, but if it's important to you, test it.
Line 63: I'm always adding tests so I call done_testing(); to tell the test when I've got to the end. It saves counting tests.
I like the PR method of talking about code because you can see the changes and put your comment right next to the line you're talking about.