views:

138

answers:

5

I have licensed my software under LGPL. I am too lazy to include the licensing headers in all files, so I skipped the unit tests files. Is that a problem?

+1  A: 

Do you really care if someone "steals" your unit tests?

I am not a lawyer but ... AFAIK, There is no legal requirement to include the license in every source file, it's just that people like covering their butts. Including your license in a clear README.txt or LICENSE.txt and in the place where you publish your source should be good enough. If this is making you lose sleep just write a script that populates the license comment.

Update based on the comment:

If you really need to get this question answered in a definate manner I suggest you contact software freedom .org

Sam Saffron
If it's really open source, and another party is really stealing it for financial gain, the the SFLC(http://www.softwarefreedom.org/) has a history of taking legal action on behalf of the owner.
TokenMacGuy
@Token, I guess then the only way to get an authoritative answer is to email: softwarefreedom.org
Sam Saffron
@Token From Eben Moglen of the SFLC, "We’re not a litigation firm; our primary task is not going to war for people. Indeed our standard retainer says that 'if you are suddenly attacked, we will help you defend yourself, and we will help you find and finance long term counsel.' But our primary goal isn’t to fight wars, we’re not funded for that. We’re funded for the less exciting and more routine job of keeping people out of trouble." In short, I would not count on the SFLC for any significant legal help in a case like this. More info at http://twit.tv/floss13
William Brendel
A: 

Laziness and skipping steps is always bad. Do the right thing. Do it efficiently. Do it always. End of story.

ojblass
Laziness is not always bad: http://en.wikipedia.org/wiki/Lazy_evaluation :p
Sam Saffron
Falls under doing it efficiently.
ojblass
I guess the real point is should you spend any effort on something that is completely pointless. IF having a license header makes NO difference THEN spending time on automating license headers is POINTLESS (regardless on if you are lazy or not)
Sam Saffron
+1  A: 

You might consider using a generic, boilerplate source file for your projects that include your name and a copyright notice. Copy it instead of creating a new file. Also be sure to check the dates and information before you check in to source control each file. This is an easy step.

TokenMacGuy
That's a good suggestion, although it doesn't directly address his question.
Quinn Taylor
+1  A: 

Adding copyright headers to every source file in your project is a very brief project for someone who knows a scripting language. If you don't know a scripting language like Perl, Python or Ruby, this is a good time to start learning one.

For example, here's a Perl script that adds a copyright header to itself:

#!/usr/bin/perl -w

use strict;

# Copyright Header Here

my $copyright_header = <<COPYRIGHT;
# MyProject v1.0
# Copyright Jader Dias, 2009
COPYRIGHT

open FILE, "<parse.pl" or die $!;
while ( my $line = <FILE> ) {
    if ( $line =~ /\#\s*Copyright Header Here/ ) {
     print $copyright_header;
    } else {
     print $line;
    }
}
close FILE or die $!;

Depending on the structure of your program, you can either replace a tag in the original file with a copyright header, or just add the header to the very top of the file.

James Thompson
+2  A: 

To directly answer the question (whether it's a problem to skimp on license headers in unit test files out of laziness), my gut answer is probably not. Open-source purists and legal experts would probably say that you need to include the license in every source file. I think that's good practice, but failing to do so is not the end of the world, especially if your code comes with a LICENSE.txt file. Even more so for unit test code, which is probably not at all applicable outside the context of your project.

I'm obviously not a lawyer, but if someone were to use your source code in a way not conducive with your license, (LGPL in this case) I have trouble imagining that arguing that the license wasn't included in a particular source file would hold too much water. I would expect someone that wants to use the code to find out what the license is beforehand, and if someone were to steal your code and call it their own, it's not okay just because there wasn't a license header in the file. In my opinion, theft is theft, whether or not there's a sign that says "You're not allowed to steal this." :-) Unfortunately, that's unlikely to be sufficient in the complex world in which we live... (sigh)

Perhaps the best answer is "better safe than sorry", but go with your instinct and the guidance of experienced developers you trust. I guess that's why you asked on SO. ;-)

Quinn Taylor