You have to work harder so that you can make it easier.

Version control: Put it under Git or something similar. That way you can easily create branches for various ideas or development tracks.

Your test suite can drive new features. As you come up with a new idea to add to the module, add a test for it. Be sure to also add tests that test the various units that contribute to the new feature, as well as testing the normal use case you anticipate. And don't forget edge cases.

make (or dmake), then you can prove: prove -b -v t/10newfeat.t. ...although I find that sometimes prove jumbles the chronology of stderr output and stdout output, so while developing I usually just, perl -Mblib t/10newfeat.t.

Here's a brief example of the steps:

  1. New idea comes to you, and after doing the necessary research.... git checkout -b newidea <= This creates a new topic branch for your project.
  2. Create a new group of tests: t/10newfeat.t <= It doesn't matter if these will end up being "finished product" within your test suite. Just code up a few tests that drive the unwritten solution how you would like to be able to use it. Mark the test(s) "TODO".
  3. git commit -a -m "Created TODO tests to drive feature xyz."
  4. Work on your new feature.
  5. Anytime you want to see how your feature is progressing, either add another driver test to your test file, or invoke the existing ones: make; perl -Mblib t/10newfeat.t.
  6. Whenever you get to a point where you wouldn't want to have to recreate work, or where you are about to take a gamble of some sort, don't forget to git commit -a -m "Milestone: xyz does abc."
  7. Repeat the above coding, testing, committing steps as long as it takes.
  8. Set a version number (possibly a Developer's version number).
  9. Update 'Changes', MANIFEST.
  10. git commit -a -m "Feature XYZ implemented."
  11. git checkout master (or whatever branch you want to merge this new feature into).
  12. git merge newidea (and iron out any merge conflicts).
  13. make realclean, perl Makefile.PL, make, make distcheck, make test, make disttest, make install, then run your test suite against the installed version. <= All steps that will help to give you confidence that you didn't miss anything along the way.
  14. Either tidy up some more, or if everything's ready to go: git tag -a -m "v0.12 Added xyz feature" "v0.12" 12asdf (the MD5 of your final commit).

Now you can push it to your external repo, upload to CPAN, move it into integration testing, go live... whatever you do next with your work.

Your steps and workflow will differ; collaboration, additional testing, keeping topic branches out of the master until after some other milestones are reached... whatever. And no two projects are alike, but that's the general notion of what seems to be my pattern.


Dave


In reply to Re: Developing a module, how do you do it ? by davido
in thread Developing a module, how do you do it ? by mascip

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.