The answer you are looking for can be found in Chapter 17 of this amazing classic Dickens novel. Having shifted educational establishments to Mr. Strong's school, much to his relief, David reports how Miss Betsy Trotwood at first came to visit him at odd hours of the day and night to ensure, he supposes, that is making use of his time and of the opportunities his education affords him. Note what the text tells us:
While I was yet new at Doctor Strong's, she made several excursions over to Canterbury to see me, and always at unseasonable hours: with the view, I suppose, of taking me by surprise. But, finding me well employed, and bearing a good character, and hearing on all hands that I rose fast in teh school, she soon discontinued these visits.
So, we can see these visits as being part of Miss Trotwood's attempts to discern whether David was working hard and settling in well to his school. The way in which these visits only came towards the beginning of his time there and stopped soon after suggests that David was right in his deduction about their purpose.