Overtake the maintenance of a software package

Recently I am using a software package which seems pretty useful, but which I don’t understand how it works internally.

This package contains software generated by several PhD students and lecturers of an university among several years, which reflects in code style. There are several papers related to pieces of this software, which I have read them but still, I am not sure I understood them correctly.

I decided to look inside the source code to understand what and how does it work:
The package lacks of test, sometimes there are defined functions that the programming language has already implemented (it is R if that matters), or two functions with overlapping functionality, different ways of notifying the user (it uses message, cat or write), and functions with 30 parameters. I found also some errors in functions (using a variable name which is the same as a base function name instead of a variable name defined inside the function). Or it defines a new class but doesn’t define methods for such class, thus making many lines of code duplicated.

I went on to try to understand the package and improve its coherence, I started by unifying the style and adding test (first time using tests), but since I am not sure of the expected output I am just testing against the results it gives for each option, or for the structure. After some time I would like to start modifying some functions, and check with the already written test that they don’t break any.

What else should I do to improve the package and my understanding of it? How can I efficiently improve my understanding of the package?

3

The mission

You have a nice software package that was made by different people, over a longer period (in which the R language has evolved, bringing in functions that had to be initially programmed from scratch) and which obviously doesn’t follow the principle of clean code.

So it’s tempting to refactor it and harmonize the code style.

The challenge

You don’t fully understand how it works.

You can’t can’t predict expected results, as you don’t fully master the subject.

The advise

It seems very ambitious to start immediately with a major refactoring under these conditions.

You should first start more modestly, by increasing your understanding. So start to build a reliable test suite for the software and its major components, without touching the internals.

Run the code with your suite, and check for any error in the test suite to understand if it’s a problem in your suite, in the test data or in the current code.

Once you are there, you can consider starting the refactoring, always testing the changes with your extensive test suite. So at least you can check that you’re not breaking (i.e. producing different results) the working code.

Take the opportunity to add more unit tests during the refactoring, to avoid that your successor will be in the same case as you.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật