Just like for the NES, the Famicom was tested in Nintendo repair shops using test carts. The test carts would essentially tell you whether or not some part of your Famicom setup was working correctly. There were several test carts, for such things as the console itself, and separately, for the controllers.
The image below shows a Famicom test cart, with the second half of the HVC code left blank, for whatever reason.
The translation:
HVC kensa cassette Controller TEST
(HVC– ) Nintendo Kabushikigaisha Ujikoujou Gijutsubu
or
HVC Examination Cassette Controller TEST
(HVC– ) Nintendo Corporation Uji Factory Technology Department