As a college student do you write unit-test for the project code you write? Do you know how to properly use TDD? Have you been taught to use testing frameworks (jUnit for example)?
I've just recently heard that a major company's project team was delivering software to User Acceptance Testing group that had only 7% line code coverage for unit testing. While that shocks me, it just tells me that this company's software engineering practice are immature. However I wonder if they could just hire a few recent graduates and raise the bar on the teams practices - assuming that these newly minted programmers were trained in the best practices.
Are you 2008 - 2010 CS graduates using best practices of unit testing your code?
I don't write unit-tests for the software I write for assignments, I usually just do some of my own testing and debugging.
Honestly, CS at my university is fairly broken, half the students are diehard passionate programmers who have learned nearly everything on their own. The other half can barely write a hello world in Java, and know no other languages and have extreme problems with even trivial programs. Students barely get much programming experience, most manage to squeak by copy & pasting code form books and the internet without really understanding it.
As part of the degree plan, you have to take courses on architecture and management that involve agile and the concepts of software testing and test driven development. However, these courses are taken pretty late (senior year) and are certainly not utilized in other courses.
If I had more time, I'd probably unit-test my code properly; unfortunately I'm working and taking 19 hours, so I've got alot of assignments and I can usually bang them out pretty quick and test them enough. I have gotten dinged a couple points for a bug here or there though, and unit-testing my code would certainly help get better grades on the assignments.
Sadly, my experience is that any REAL software development, any type of real-world systems programming or coding standards or best practice is done by those who write code on the weekends, and read about it on their own, and look for it on their own. The students who just go to class, I can't imagine how they're going to get hired. You get shown what all exists and that you need to know it in class, but not enough implementation.
Professors can't grade 50 students' programming assignments every week, so if they want to have lots of actual practice, they have us do group work. This results in the one or two good programmers doing almost all the work, and the rest follow along and try to read and modify their code. Maybe other Universities are better, and I think they claim to be; but I think in practice they aren't really any different.
As a college student do you write unit-test for the project code you write?
MS thesis project; sorta. I do interactive testing with Lisp/Slime. Some stuff gets unit tests, some stuff doesn't.
Do you know how to properly use TDD?
Meh, tried it, didn't see the point. Rather test during than before.
Have you been taught to use testing frameworks (jUnit for example)?
Why should a professor waste our time teaching me an API? If I can't learn an API, I need to leave the field.
(I graduated in 2008)
We learned ABOUT unit testing, and had to do so for some assignments in a class called "Team Software Project". The class was about software engineering practices. Other than that one class, it wasn't mentioned, but that class was required to get a BSc in Computer Science. The Computer Science department also offered a Software Engineering concentration that was more project-based, with classes devoted to testing, HCI, project management, etc. but still with a theoretical CS core.
Time is a big factor in this. You could do one programming assignment per month with time to TDD it, or you could do one every two weeks with some other testing method. In the workplace, the month is worth it because you will live with that code for months/years/decades, and maybe even make money from it. In the classroom where it's written and promptly thrown away (if not immediately at last check-in, at least at the end of the semester, maybe at the end of two for some special projects class), it just doesn't make educational sense. Your professor would rather you learn twice as many programming concepts through personal experience (a project), than learn one concept and spend weeks making the code bulletproof.
The goals are different. With the exception of a software engineering course, required-TDD on all projects might actually be a warning sign of a less-than-optimally-effective instructor at the college-project level (you're going to learn less).
And for laughs, there's always the silly case of write a unit test for Hello World before you know how to program... because you're learning how to write your first program :) Laugh. Do not take hello world example seriously.
In my university you can't complete a Software Engineering degree without taking a particular subject that focuses on teaching Agile software development methodologies. In that subject you can't claim any feature's implemented without reasonable testing through JUnit and Selenium.
However: TDD was taught but not enforced and due to group work some students could avoid exposing themselves to Selenium and/or JUnit.
Generally when the coverage is so low it has nothing to do with the skill level of the developers or how recently they graduated.
Usually two things have caused this, old code that was written before TDD was common (when much of your code base was written ten years ago, it would be extremely unlikely that you would have test coverage) and tight (often impossible) deadlines. Testing is one of the first casualties of the impossible deadline.
So adding new people more familar with testing is unlikely to change either fo those two conditions and test converage will likely only slowly improve.
That said, I personally have only rarely seen a recent graduate who cared much about testing. That is because the projects they work on in school are both small and not in need of maintenance over time. So the critical reasons for test converage are not there and most studnets don't do TDD routinely. Recent grads often also have to be taught about using source control. There is a huge difference between working on enterprise software and class assignments and thus these things are not really on their radar until they get dropped into a large and continuing project.
Just graduated recently with a degree in CS. I can honestly say that besides material that was focused on testing, I was never required to turn in tests. That doesn't mean I didn't write them though. I wish my school had discussed testing more. Testing, and source control.