The book and movie Starship Troopers use many of the same characters and setting but both the plot and presentation differ enough for the movie to be "based on the book by Robert Heinlein."
Many people who have seen the movie then read the book are surprised to encounter a much more philosophical and reasoned discourse, almost didactic rather than a straightforward action-adventure.
Many people who have read the book then seen the movie feel that the movie is based on "the first 100 pages" (a quote attributed to the movie's director) and gives short shrift to the ideas which won the book a Hugo Award.