I guess your concept of Unit Testing is not correct. Technically speaking, "Unit Testing" is a software verification and validation method in which a programmer tests if individual units of source code are fit for use. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual function or procedure and in Object Oriented Programming it may be a method of a class.
What you want to do is basically "doing smaller programs first and then making them complex gradually (and in the course you will learn the programming eventually)". This type of software development "start with simpler and then make it complex gradually" is called "Software Prototyping" technically. Here is a definition of it:
"Software prototyping, an activity during certain software development, is the creation of prototypes, i.e., incomplete versions of the software program being developed.
A prototype typically simulates only a few aspects of the features of the eventual program, and may be completely different from the eventual implementation.
The conventional purpose of a prototype is to allow users of the software to evaluate developers' proposals for the design of the eventual product by actually trying them out, rather than having to interpret and evaluate the design based on descriptions. Prototyping can also be used by end users to describe and prove requirements that developers have not considered, so "controlling the prototype" can be a key factor in the commercial relationship between solution providers and their clients."
On the other hand, Unit Testing is a just one of the methodology in "Software Testing". It is not a part of Software Development beginning. It is done at the end when fairly large program has been created and to ensure every piece (ie. smaller units like functions, procedures, class methods etc.) are working correctly. Unit Testing can not be used to base a software development because at the end if Unit Testing results into "any one piece has error" it certainly means the whole software is erroneous while if Unit Testing says "all pieces have no error, it doesn't mean that whole software is error free" because there may be some error in integrating those pieces or Unit Testing cannot be expected to catch every error in the program: it is impossible to evaluate every execution path in all but the most trivial programs. The same is true for unit testing. Additionally, unit testing by definition only tests the functionality of the units themselves. Therefore, it will not catch integration errors or broader system-level errors (such as functions performed across multiple units, or non-functional test areas such as performance). Unit testing must be done in conjunction with other software testing activities. Like all forms of software testing, unit tests can only show the presence of errors; they cannot show the absence of errors.
To obtain the intended benefits from unit testing, rigorous discipline is needed throughout the software development process. It is essential to keep careful records not only of the tests that have been performed, but also of all changes that have been made to the source code of this or any other unit in the software. Use of a version control system is essential. If a later version of the unit fails a particular test that it had previously passed, the version-control software can provide a list of the source code changes (if any) that have been applied to the unit since that time.
It is also essential to implement a sustainable process for ensuring that test case failures are reviewed daily and addressed immediately. If such a process is not implemented and ingrained into the team's workflow, the application will evolve out of sync with the unit test suite, increasing false positives and reducing the effectiveness of the test suite.
I hope now you have better understanding of the term "Unit Testing". And what you want to do is learn by "software prototyping". Well, as far as learning is concerned you can opt any way ie.
a) Read a lot of programs before you code one
b) Just read few basics of any programming language and start creating simpler programs and later on make them complex with your increased knowledge.
Option (a) takes less time to get you on the expert's way and also there is a less chance to adopt wrong practices that you may develop during "Self learning programming"
Option (b) takes more time to get you on the expert's way but may be you may devise your own style of programming and may be it becomes as good as (if not better) other expert's style of programming.
I RECOMMEND DON'T CHOOSE ONLY ONE WAY of the above mentioned options (a) or (b). USE A MIX OF BOTH AND START WITH OPTION (a).
Happy Programming! Welcome to the Crazy Community!