Modification in this case is anything that is a non-trivial change to the source code.
So what are some examples of trivial change?
- White space only changes or other formatting such as line breaks.
- Renaming variables
- Renaming a file or module
Notice that the trivial changes don't do anything to the programmatic flow of the application.
Non-trivial changes would include:
- Re-working algorithmic flow
- Adding functionality (logging, tracing, enhancements)
- Bug fixes
Notice that the non-trivial changes are additive or that they affect the program's flow.
They are some grey areas, though. For example, refactoring a method by extracting some portions out may or may not be trivial. It depends upon the complexity of the extraction and what needed to be re-arranged in order to support the extraction. Likewise, extracting cut & paste blocks of code into a single method requires some analysis to determine if it's not trivial.
So let's tackle your questions.
Reading the original sources and then re-implementing a custom way.
I'm going to go with non-trivial and therefore a modification to the original code. Key aspect here is re-implementing [in] a custom way
. It wasn't a copy & paste exercise; you had to put significant effort into implementing and validating your work.
Reading the original sources, waiting for a year and then re-implementing something based on whatever you could remember.
Hard to say, and could go either way. "Waiting time" has nothing to do with determining whether or not the modification was trivial. For example, you could have a photographic memory and were therefore able to re-write the code verbatim from memory. It's an impressive feat but it wouldn't qualify as a modification. On the other hand, you could end up with a complete re-write of the algorithms and therefore have created a non-trivial change.
Direct and very significant "complete" refactoring of the original sources.
Definitely a modification of the original code. Complete refactoring
implies re-arranging significant amounts of code and altering the program's flow.
Getting at the peripheral of your question, why would you care so much about whether or not a change counts as a modification. If you make a non-trivial change to the code, then you own the copyright to that change. And even though the BSD license gives you pretty much free reign to do whatever with the original project, if you re-wrote the entire project then you can lay claim to all of the copyright of the new project.
Courtesy would suggest acknowledging the earlier project as inspiration, but you're not legally obligated to do so once you've completely re-written a project. And if you haven't completely re-written the project then you'll need to abide by the clauses of the BSD license.