Watch the Scales & Leading Tones online guitar lesson by John Goldsby from Upright Bass Handbook
In this etude, we're using three notes from a scale followed by a leading tone into the root of the chord in the following bar. We'll play each 12-bar example two times.
All of the lines in this etude use notes found in the half- and first-position. So, you're already acquainted with these notes. The important thing to note is that these lines are moving up and down stepwise, or diatonically--which means inside a defined key signature, key center or mode.
It's important to note that there are no theoretical magic formulas that always work. The ultimate guide is to listen and hear what works well in the context of the music. But, we can always analyze a bassline and say whether a particular note is a chord tone, a scale tone, or a chromatic passing or leading tone.