I am facing some issues with a buggy library I currently have and it’s used in my current project, I need to finish this project as soon as possible in order to deliver it to our client.
However, this library is horrible!
Lots of bugs, lots of errors and bad performance, I thought to write my own library to handle what that library handles (GUI/Graphics and some Data manipulation) but I lack time to do it.
I have wasted a lot of time repairing this library thus I am very close to my deadline with 85% completion and still lots of bugs I face and fix everyday.
Maybe you will ask me the following question:
Why did you use it in the first place if you knew it was buggy?
I will answer that question, the reason why is because the buggy library is considered a standard in out company; plus, I am not the only one who thinks that library is buggy, almost all developers hates it!
My question is, should I deliver the current project with that library then develop a new library and use it to enhance the project after that deliver it to the client again as an update, or develop the new library and restart the whole project using the new one? and why?
8
As I was told: “A 80% solution in time is better than a 100% solution too late”. I’d finish it using the legacy library and deliver an update later. It is important to plan this update in advance, ideally now. As mentioned by ElYusubov, Design by Contract is a good keyword. You could keep the interface of the library, in that way there would be a sooth shift, even in other projects. If the interface itself is that flawed and rusty, a Bridge might be helpful.
4
I would consider writing a set of unit tests for the library in question, which exercise just the functionality you NEED from the library (but do so fully), and then see if the library works correctly for just what you need or if you trigger enough bugs for it to be unusable.
If not you now have a set of unittests from which you can easily create your own library.
5
As you have also mentioned, first wrap-up your project and try to deliver on time as soon as you can. However, while delivering project replace dependencies
on your so called “buggy library” through introduction
of the Design by contract principle.
In some terminology it is called Programming with Contracts, where a contract
merely defines the requirements of a particular class; it does not actually control the class implementation. The purpose of a contract is to make sure that the intended design specifications are satisfied and not at conflict with each other. In other words a contract helps identify design flaws.
2